From foxgui-users-admin@lists.sourceforge.net Wed Mar 26 17:13:54 2003 From: Jeroen van der Zijp To: "Strauss, Nicholas C" Subject: Re: [Foxgui-users]multiple concurrent processes/tasks RJLRef: ~/02f522/bdefoxthreads, $PH/COOL-BDE/bdefoxthreads On Wednesday 26 March 2003 02:20 pm, Strauss, Nicholas C wrote: > All, > > How would I use FOX on Linux where I've got multiple concurrent > processes or a multithreaded application? Can I just use the > pthreads library, or should I look at other ways to have inter-process > communication? Just use pthreads. However, ONLY ONE THREAD should be responsible for all of the GUI. You can synch threads using UNIX pipes and FOX's addInput() facility. For example to wake up GUI thread you can let GUI thread wait on a reading end of a pipe using addInput(), and then the GUI thread can be woken up by a worker thread simply by writing a byte into the writing end of the pipe (you can perform a non-blocking read/write by setting the appropriate ioctl's). [On Windows, we can actually do better:- since FOX can pass all kinds of operating system HANDLE's to addInput(). But one caveat if you ever were to port your code to Windows: make sure the SAME single thread is in charge of the GUI, because the message queue is associated with a PARTICULAR thread, i.e. the threads are not interchangable like under UNIX]. Hope this helps, Jeroen