public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Conditions, flags and mutexes
@ 2001-02-27  1:25 Björn Stenberg
  2001-02-27 10:17 ` Jonathan Larmour
  0 siblings, 1 reply; 2+ messages in thread
From: Björn Stenberg @ 2001-02-27  1:25 UTC (permalink / raw)
  To: ecos-discuss

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

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".

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?

Please enlighten me! :-)

/Björn

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] Conditions, flags and mutexes
  2001-02-27  1:25 [ECOS] Conditions, flags and mutexes Björn Stenberg
@ 2001-02-27 10:17 ` Jonathan Larmour
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Larmour @ 2001-02-27 10:17 UTC (permalink / raw)
  To: Björn Stenberg; +Cc: ecos-discuss

[-- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-02-27 10:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-27  1:25 [ECOS] Conditions, flags and mutexes Björn Stenberg
2001-02-27 10:17 ` Jonathan Larmour

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).