[Gtk-sharp-list] ThreadNotify

Michael Meeks michael@ximian.com
10 Oct 2002 12:08:04 +0100

Hi Vlad,

On Thu, 2002-10-10 at 07:27, Vladimir Vukicevic wrote:
> Basically, in ThreadNotify, when a thread is to be "notified", a byte is
> written to a fd.  There's a GIO event waiting for data to be available
> on that pipe,and when there is, the byte is consumed, and the user
> callback is called.

	I don't quite understand what the problem is, beyond the fact that the
threads are de-coupled. Ultimately (surely) - depending on how long the
processing code is that handles the event in the main-thread, many
events can pile up being pushed from the other thread.

	If you want to block the other thread while waiting for the main-loop
to process the request; then I assume you want a different sort of
locking primitive. Surely making all notifications block the notifier is
not a good model ;-)

	Ultimately surely, in any threaded world - notifications should contain
either no state, or sufficient state for the listener to act; since
subsequent fetches of state from the object may result in odd effects



 mmeeks@gnu.org  <><, Pseudo Engineer, itinerant idiot