« Return to Thread: Spinlocks

Re: Spinlocks

by Felipe Sateler :: Rate this Message:

Reply to Author | View in Thread

I am trying to implement the spinlocks with pthreads. However, multithreading
does not work for me, there seems to be a race condition somewhere, since it
hangs if I run it normally, but not if I run it under gdb. Valgrind says the
following:

==24848== Possible data race during write of size 8 at 0x90560c8 by thread #1
==24848==    at 0x40B481: kperf (csound.c:1320)
==24848==    by 0x40B8B1: csoundPerform (csound.c:1447)
==24848==    by 0x40550E: main (csound_main.c:136)
==24848==  This conflicts with a previous read of size 8 by thread #3
==24848==    at 0x40AF5D: kperfThread (csound.c:1226)
==24848==    by 0x4C27ABF: mythread_wrapper (hg_intercepts.c:194)
==24848==    by 0x5092FA9: start_thread (in /lib/libpthread-2.9.so)
==24848==    by 0x61C42CC: clone (in /lib/libc-2.9.so)


I'm not sure if this is relevant, it is the multiThreadedStart variable that
conflicts. Maybe the reads and writes of it should be protected?

El 30/04/09 10:22 Felipe Sateler escribió:

> Pthreads-w32 (which is what I think you are using on windows) claims to
> support it. Can someone from the mac world confirm if they are available?
>
> 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


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