public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Fabian Scheler <fabian.scheler@gmail.com>
To: "Paul D. DeRocco" <pderocco@ix.netcom.com>
Cc: eCos Discuss <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] Mutex & Asserts during initialisation
Date: Mon, 11 Jul 2005 07:52:00 -0000	[thread overview]
Message-ID: <69dd805e05071100527149ccaa@mail.gmail.com> (raw)
In-Reply-To: <NEBBKHCFDGIGIJEHDJFCMEPFPJAA.pderocco@ix.netcom.com>

Hi,

> > Humm, i think this is reasonable behaviour. Anything that tries to use
> > a mutex must assume it can block. Otherwise why are you using a mutex!

well, this is a reasonable solution,

> I can see the other side of this. You want to write a driver that can work
> in a multi-threaded environment, so you include a mutex in it. But then you
> want to call it from startup code. Rather than write a second specialized
> non-multi-threaded driver, or include some sort of flag that tells it to
> skip the locking and unlocking, it's much cleaner to simply consider the
> attempt to lock a mutex before the threading system has been initialized a
> harmless null operation.

while this is not. You better should design your driver properly, so
it can cooperate with the operating system, the driver is developed
for, not vice versa. Within a clean layered software design it just
means to add one more layer to make your driver thread safe! During
startup you can still use a layer where no thread synchronization is
necessary. You can add this new layer with the help of C++
inline-functions in a very efficient manner, for example. Another
possibility is to use AOP for this purpose, compare "Using AOP to
Develop Archtiecture-Neutral Operating System Components"
(Spinczyk+Lohmann), for instance.

Ciao, Fabian

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2005-07-11  7:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-08 12:15 Will Wagner
2005-07-08 14:08 ` Andrew Lunn
2005-07-08 14:18   ` Will Wagner
2005-07-09 14:30   ` Paul D. DeRocco
2005-07-11  7:52     ` Fabian Scheler [this message]
2005-07-11  9:36     ` Nick Garnett
2005-07-11 10:30       ` [ECOS] issues: memcpy in flash_config_insert_value & exec -r Michael Anburaj
2005-07-12  1:22         ` [ECOS] SOS: " Michael Anburaj
2005-07-12  1:30           ` Gary Thomas
2005-07-11 10:47       ` [ECOS] Mutex & Asserts during initialisation Bart Veer

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=69dd805e05071100527149ccaa@mail.gmail.com \
    --to=fabian.scheler@gmail.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=pderocco@ix.netcom.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).