public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Jonathan Larmour <jlarmour@redhat.com>
To: Björn Stenberg <bjst@contactor.se>
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Conditions, flags and mutexes
Date: Tue, 27 Feb 2001 10:17:00 -0000	[thread overview]
Message-ID: <3A9BEF47.5585BA57@redhat.com> (raw)
In-Reply-To: <Pine.GSO.4.30.0102271013140.15781-100000@pm1.contactor.se>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1301 bytes --]

Björn Stenberg wrote:
> 
> Is there a description somewhere that details the conceptual differences
> between conditions, flags and mutexes, and why they are all implemented?
> The reference manual tells me how to use them, but is short on "why".

And you forgot semaphores :-).

I think you want a book on concurrency theory. My personal recommendation
is "Concurrent Systems" by Jean Bacon, published by Addison Wesley.

> I don't understand what conditions do that mutexes don't. Serializing
> multiple threads' access to data? Mutexes can do that. Waking up several
> threds at once? Fine, so why do we need mutexes then? Also, what is a flag
> other than a "multi-mutex"? Why do we have mutexes if flags are a superset
> of them?

A short answer is that there *is* deliberate overlap between these
features. The kernel does not impose policy on how programmers care to
write their program. Instead we just give a box of tools with some of the
most common paradigms.

Flags are uniquely useful in that it is much more complex to do "AND"
semantics for events using the other primitives. Counting semaphores come
close, but not quite.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

      reply	other threads:[~2001-02-27 10:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-27  1:25 Björn Stenberg
2001-02-27 10:17 ` Jonathan Larmour [this message]

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=3A9BEF47.5585BA57@redhat.com \
    --to=jlarmour@redhat.com \
    --cc=bjst@contactor.se \
    --cc=ecos-discuss@sources.redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).