DragonFly BSD
DragonFly users List (threaded) for 2005-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Question about threading implementation

From: Jonathon McKitrick <jcm@xxxxxxxxxxxxxxxxx>
Date: Tue, 8 Mar 2005 03:09:30 +0000

On Tue, Mar 08, 2005 at 10:49:07AM +1000, Andrew Hacking wrote:
: On Mon, 2005-03-07 at 22:24, Jonathon McKitrick wrote:
: > On Mon, Mar 07, 2005 at 11:43:53AM +1000, Andrew Hacking wrote:
: > : Calling sleep() in a multi-threaded program is probably not safe since
: > : it suspends the process, not just the thread.
: > : You should always call nanosleep() in multi-threaded apps.
: > 
: > Are you sure nanosleep() doesn't suspend the process?
: > 
: As sure as I can be. ;-)
: I remember experiencing a number of problems with sleep() on at least
: one or more unix variants when using threads.
: However I have used nanosleep() sucessfully on FreeBSD, Solaris, Linux,
: AIX and HP-UX.
: The FreeBSD implementation of sleep() is based on nanosleep() [according
: to the man page] so I was probably wrong to say don't use sleep() in

Okay, I believe you.  :-)  But the man page talks only about processes and
does not mention threads.

Jonathon McKitrick
My other computer is your Windows box.

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]