<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body dir="ltr" bgcolor="#ffffff" text="#000000">
Gilboa Davara wrote:
<blockquote
cite="mid:1260433986.30719.10.camel@gilboa-home-dev.localdomain"
type="cite"><br>
<pre wrap="">
Why?
- Write code that can run more-or-less the same as kernel module and as
a user-space library. (And under multiple different OS')
- Implement fast spinlocks and/or RW locks in user mode. (Again, that
behave the same under kernel mode and user mode.)
- Atomic counters.
- Anything else that can use the "lock" prefix.
- Gilboa
</pre>
</blockquote>
I'll just point out that all of the above only make sense if you are
guaranteed low contention. If not, using the OS supplied locking
mechanisms will bring much better performance, due to the fact that
locked tasks do not take CPU time (are scheduled out).<br>
<br>
If you can guarantee extremely low contention, yes, there is *SOME*
sense. If not, I think this is premature optimization.<br>
<br>
Shachar<br>
<pre class="moz-signature" cols="72">--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
<a class="moz-txt-link-freetext" href="http://www.lingnu.com">http://www.lingnu.com</a>
</pre>
</body>
</html>