[Gtk-sharp-list] ThreadNotify: The saga ended...:)

Miguel de Icaza miguel@ximian.com
31 Oct 2002 12:02:24 -0500


> I think I found the best solution to my problem. I made a custom class
> derived from Queue, and did override Queue.Enqueue to raise an event
> whenever it is used. 
> Now when one thread puts something in the Queue, it automatically
> raises the event, and the event handler calls ThreadNotify.WakeupMain.
> This way my back end utilities just communicate via the queue and know
> nothing about ThreadNotify, and voila', the uggliness is gone. Also,
> no need to poll the queue for new messages. 
> I know the negative side of using threads, but I prefer them because
> they are a more natural way to express oneself when programming. I'm a
> cabeza-dura, I know! :) but this is a small project, so I can afford
> using them. 

I am glad that you were able to fix this problem, but despite that, it
would make sense to have support for having the main loop callback
routines based on the .NET file handles from the Gtk# main loop.

I CCed Dick, because he might know how to do this.