On Tue, 2007-06-26 at 23:50 -0700, Romeo AHOHE wrote:
Hi,
I have a question about POSIX threads programming regarding the program below. Basically, I have 3 threads that are doing nothing but printing a message and a 4th thread which continuously loop until all the other 3 threads terminate. To check that the other 3 threads terminate properly, the 4th thread make calls to pthread_getschedparam(). I tested the code on a machine running FreeBSD 5.3 and everything works fine. However, the behavior of the program is completely different on machines running Linux or Cygwin. The problem on those machines is that pthread_getschedparam() does not return the proper error code (ESRCH) even when the thread id that was passed to it
What does it return instead of ESRCH? As you do a pthread_join after each thread is started, the final thread you start should always find all the other threads are already finished. Is that intended? -- Roger Oberholtzer OPQ Systems / Ramböll RST Ramböll Sverige AB Kapellgränd 7 P.O. Box 4205 SE-102 65 Stockholm, Sweden Tel: Int +46 8-615 60 20 Fax: Int +46 8-31 42 23 --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org