Pthread spin locks
Peter Holmes
peter_holmes2003 at yahoo.com
Tue Mar 13 17:04:25 UTC 2007
I am not very sure about the spin lock behavior of pthreads.
Here is the man page description:
The pthread_spin_lock() function will acquire lock if it is not currently
owned by another thread. If the lock cannot be acquired immediately, it
will spin attempting to acquire the lock (it will not sleep) until it
becomes available.
For a single processor scenario.
Let's say a pthread owns the lock and is blocked and now another thread tries to acquire it. Will the second thread not block until the first thread releases the lock.
- Peter
---------------------------------
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
More information about the freebsd-hackers
mailing list