Subj : Re: help with basic multithreading in C on solaris To : comp.programming.threads From : Winbatch Date : Sat Feb 26 2005 03:58 pm "Leon Mergen" wrote in message news:1109433856.3938.9.camel@localhost.localdomain... > On Sat, 2005-02-26 at 15:14 +0000, Winbatch wrote: >> Basically, I wanted to see if it >> would be faster to write to 4 files at the same time (parallel) rather >> than >> 4 in a row (serially). > > Since writing to files uses functions which might block, this is indeed > true, provided that you don't take thread initialization into account > (use a thread pool, for example). > > >> however, when my multithreaded code executes, it >> seems to do them in order anyway (I expected to see Starting/Ending all >> mixed rather than in order). > > I haven't got any experience with C pthreads (i'm using C++ > boost::threads personally), but could it perhaps be that the time to > initialize a thread is longer than to actually execute the thread's > function, thus resulting in an ordered list of start/end calls ? > > Regards, > > Leon Mergen > I got the printouts about starting the threads immediately, so I don't think initialization takes a long time.. (unless I misunderstand you). I would prefer to do multithreading in C++ rather than C, but all the resources I found seem to use C multithreading. Do most people use boost or is there something more 'out of the box/standard to C++'? .