[email protected] wrote: > Author: matt > Date: 2007-03-06 12:15:03 -0500 (Tue, 06 Mar 2007) > New Revision: 5729 > Log: > This is a suggested change. It is complete except for documentation.
Um, can we discuss these changes before making them? One of the reasons I didn't go for a memory-queued RPC approach was because of the added locking and memory usage... > I did not like the awake_cb system at all. These changes implement > Fl::awake(Fl_Awake_Handler, void*) which is called from a thread and tells > the main loop to call the specified handler (rather a callback I guess) as > soon as possible from within the main thread. It is implemented as Fifo > (currently 1024 entry ring buffer), so handlers are called in the order that > they are generated in. > > "test/threads" was modified to change the label color as soon as a thread > reaches 10000 - pretty boring, but it show the wonderful simplicity of this > approach: you can write libraries that don't need to add to the main loop or > register a handler at all... . > > I will do some more stress testing tonight. Yeah, you'll need to since now Fl::awake() can deadlock if you already have called Fl::lock() in the current thread! I think you need to add a separate mutex just for the ring buffer. This will avoid the deadlock cases and may improve performance since you don't have to wait for the main mutex to free up. -- ______________________________________________________________________ Michael Sweet, Easy Software Products mike at easysw dot com Internet Printing and Document Software http://www.easysw.com _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
