From: K. F. <kfr...@gm...> - 2011-09-18 19:34:14
|
Hi Venu! On Sun, Sep 18, 2011 at 3:03 PM, Venu Gopal <gop...@ya...> wrote: >>> Why not using pthread for all three OSs? >>> >>>Its not that you will be able to distribute your application without >>>any external DLL ... (you will need at least mingw10.dll) so packing >>>another DLL (i.e. pthreadGC32.dll) should not be a problem, not to >>>mention it will simplify your code >>> >>>The pthreadGC32.dll is already distributed that bundled in codelite > > Eran: Agreed, for the GUI. > > Right now I am building my own application framework to create > multi-threaded apps. These apps could be simple console apps or GUI apps. > For GUI apps, I don't mind external DLLs. For the console apps I wish to > have > a simple executable with no "dll/.so" dependencies - put the darn thing > somewhere > and just execute it ( note: this is just my desire, that is all). > ... To follow up on an earlier suggestion in this thread: Why not use the standard std::thread facilities of the upcoming c++0x standard? (Unless you want to restrict yourself to c, rather than c++, which I don't think is an issue, based on the preceding discussion.) That would seem to be the "forward-looking" way to go, and you won't have to write your own os-dependent threading wrappers. std::thread works out-of-the-box with recent g++ versions on linux. It is alleged to work on windows using mingw-w64, a project distinct from, but similar to mingw: http://sourceforge.net/mailarchive/message.php?msg_id=28014252 It is also easy to patch mingw to get std::thread working (basically relying on pthreads-win32 to take advantage of the pthreads implementation of std::thread that ships with recent versions of gcc, at the cost of becoming dependent on the pthreads dll). You can see my earlier thread on this here: http://sourceforge.net/mailarchive/message.php?msg_id=26533138 Good support for std::thread exists in g++ today, and it's only going to get better and more widespread, because it's a central part of the new standard. > ... > Venu P. Gopal Good luck. K. Frank |