On 11/5/05, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: > > On linux, be sure to include the 'cthreads' as the first unit in your > program's uses clause > if you want to use threads. This will install the C thread manager. > > Note that X is NOT multithreaded, so you must synchronize all output with the > main thread. >
i'm a little curious, so i wanted to follow up. as i'm sure most of us know, threading is really not about whether you can spin a thread or not. the hard work in threading is of course to make sure that your own code, and more importantly, all of the runtime code your are linking with is thread safe. so Michael, your comment about X is meant to convey the fact that the UI subsystem on Linux, namely X and all of the subsystems in contains, are not thread safe ? are all _other_ units in the FPC and Lazarus runtime known to be thread safe (barring bugs of course) ? presumably there can be other gotchas with non-thread safe libs ? i assume the 'c' runtime on linux is pretty safe these days. i don't know whether all linux distros compile code with multi threaded flags ? i use Gentoo, and i think there are packages sometimes that require you to specify multi threaded flags, it isn't the default. are there any references on threading/cross platform mechanisms for writing portable, threaded code ? for instance, in Java, there are mechanisms for interacting with the UI event dispatching thread, so that you can update/interact with widgets in a thread safe fashion, which is i assume what you were talking about with X and "coordinating". are these mutexes/guards going to be platform specific ? i don't have too much experience with MT on Linux, so i was curious if there were more thoughts on the subject. > > Michael. Tony _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives