<div dir="ltr"><br><br><div class="gmail_quote">On Wed, Dec 9, 2009 at 10:35 PM, Micha <span dir="ltr"><<a href="mailto:michf@post.tau.ac.il">michf@post.tau.ac.il</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On 09/12/2009 18:49, guy keren wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Erez D wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
hi<br>
<br>
hi do i do atomic operations in linux (userspace) ?<br>
<br>
i need somthing like testAndSet32()<br>
<br>
<br>
thanks,<br>
erez.<br>
</blockquote>
<br>
you need to use inline assembly to do this.<br>
<br>
it looks like glib has support for atomic operation (thought i've never<br>
used it).<br>
<br>
also, g++ seems to have support for atomic operations,as a non-standard<br>
extention.<br>
<br>
</blockquote>
<br></div></div>
Just about any threads library (pthreads, boost, wxwidgets) should have atomic opration support (at least critical sections and mutexes). Not sure if that is what you want though<br>
<br></blockquote><div><br>i was porting some code from windows to linux and they used atomic test and set, so i wanted to replace that with similiar linux code.<br><br>however, in the end i removed all this code and replaced the higher class with pthread_spin_lock and unlock<br>
<br><br>thanks<br>erez.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
--guy<div class="im"><br>
<br>
_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il" target="_blank">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
</div></blockquote><div><div></div><div class="h5">
<br>
<br>
_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il" target="_blank">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
</div></div></blockquote></div><br></div>