lkml.org 
[lkml]   [2002]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectfutex API docs?
Hi all!

I've been trying to understand how futexes work looking at the last
dev. kernel. I've not found any docs. Are there any?

Basically:

P (fast P sem op):

if (atomic_decrement(sem)<0)
sys_futex(..,FUTEX_WAIT,....);

V (fast V sem op):

if (atomic_increment(sem)<=0)
sys_futex(..,FUTEX_WAKE,....);

Futexes need be counting semaphores since there could be WAKEs in
the middle of atomic_decrements and WAITs (not atomic) but I do
not see this in the code. I can't find the kernel counter in the
sources

Can anybody help me?

Many thanks in advance

Please CC to my e-mail since I'm not subscribed.

Cheers

Francesc
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:29    [W:0.179 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site