All of lore.kernel.org
 help / color / mirror / Atom feed
From: Francesc Oller <francesc@mat.upc.es>
To: linux-kernel@vger.kernel.org
Subject: futex API docs?
Date: Tue, 08 Oct 2002 13:24:48 +0200	[thread overview]
Message-ID: <3DA2C080.3B3A@mat.upc.es> (raw)

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

                 reply	other threads:[~2002-10-08 11:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3DA2C080.3B3A@mat.upc.es \
    --to=francesc@mat.upc.es \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.