public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Race free attributes in sysfs
@ 2007-05-20 11:01 Pierre Ossman
  2007-05-21  3:12 ` Dmitry Torokhov
  2007-05-21 17:50 ` Kay Sievers
  0 siblings, 2 replies; 20+ messages in thread
From: Pierre Ossman @ 2007-05-20 11:01 UTC (permalink / raw)
  To: Greg KH, LKML

Hi Greg,

I'm reworking the sysfs stuff in the MMC layer to be a bit more flexible, but
there is one thing that has me baffled; how do you add attributes to an object
in a race free manner when you have a dynamic set of attributes.

I've looked at other parts of the kernel and they all use:

1. Add object.
2. Add attributes.

To me, it seems like there's a window between 1 and 2 where the object is in
/sys but doesn't have the proper attributes. Life for user space gets very
annoying if it has to add artificial delays to avoid this window.

So how do I do this properly? Something like this would, from my point of view,
be the sane method:

1. Add hidden object.
2. Add attributes.
3. Show object.

Rgds
-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2007-05-27  9:13 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-20 11:01 Race free attributes in sysfs Pierre Ossman
2007-05-21  3:12 ` Dmitry Torokhov
2007-05-21  7:47   ` Pierre Ossman
2007-05-22 21:24   ` Mark Lord
2007-05-23  2:43     ` Dmitry Torokhov
2007-05-23  4:21       ` Greg KH
2007-05-23 13:27         ` Mark Lord
2007-05-23 15:14           ` Greg KH
2007-05-26 16:12             ` Bill Davidsen
2007-05-27  8:57               ` Greg KH
2007-05-21 17:50 ` Kay Sievers
2007-05-21 18:43   ` Pierre Ossman
2007-05-21 19:28     ` Kay Sievers
2007-05-22  8:38       ` Cornelia Huck
2007-05-23  4:25         ` Greg KH
2007-05-22 15:40       ` Pierre Ossman
2007-05-22 15:58         ` Kristian Høgsberg
2007-05-22 21:25         ` Mark Lord
2007-05-23  4:24         ` Greg KH
2007-05-23  5:44           ` Pierre Ossman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox