« Return to Thread: Spinlocks

Re: Spinlocks

by Felipe Sateler :: Rate this Message:

Reply to Author | View in Thread

Apparently these are provided by Linux, pthreads-w32 and OSX 10.4 onwards. BSD
also seems to have support for them, and I can't find anything on solaris.

However, all of this could be avoided by switching from spinlocks to mutexes.
All implementations of pthreads have to support mutexes (at least since the
UNIX98 spec). The downside of using mutexes is that it can be slower if (and
this is a big if) the thread holding the lock is still running, and will
release the lock in a very short time. All other cases are better handled
with mutexes.


El 30/04/09 01:44 Michael Gogins escribió:

> Insofar as I recall, which may not be all that far, the pthread
> spinlocks were not available on all platforms.
>
> if they are, they would be better, I think.
>
> Regards,
> Mike
>
> On 4/29/09, Felipe Sateler <fsateler@...> wrote:
> > I have received a report that csound does not build on SPARC machines due
> > to some issues with __sync_* intrinsics. While I am still trying to debug
> > the issue, the question of why these intrinsics were used in the first
> > place was raised. In fact, we already use pthread, and pthread provides
> > spinlocks too. Is there any reason for not using the pthread ones?
> >
> > Saludos,
> > Felipe Sateler


Saludos,
Felipe Sateler


------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Csound-devel mailing list
Csound-devel@...
https://lists.sourceforge.net/lists/listinfo/csound-devel

signature.asc (204 bytes) Download Attachment

 « Return to Thread: Spinlocks