public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Vincent Catros" <Vincent.Catros@elios-informatique.fr>
To: "'David Woodhouse'" <dwmw2@infradead.org>
Cc: <ecos-discuss@sources.redhat.com>
Subject: [ECOS] RE : [ECOS] Is JFFS2 thread-safe?
Date: Thu, 27 Nov 2003 17:02:00 -0000	[thread overview]
Message-ID: <000e01c3b508$b6f34d30$7407a8c0@figuier> (raw)
In-Reply-To: <1069892845.14994.47.camel@imladris.demon.co.uk>

Davis,

> -----Message d'origine-----
> De : David Woodhouse [mailto:dwmw2@infradead.org]
> Envoyé : jeudi 27 novembre 2003 01:27
> À : Vincent Catros
> Cc : ecos-discuss@sources.redhat.com
> Objet : Re: [ECOS] Is JFFS2 thread-safe?
> 
[...]
> In fact, I suspect that is actually OK because we set the
> CYG_SYNCMODE_FILE_FILESYSTEM flag and hence the fileio layer ensures
> that only one file system method is invoked at a time. It would be
> better to do our own locking and drop that flag though, since it makes
> coordinating the locking with gcthread.c a little nicer.
> 
> Your underlying flash drivers may also need to be thread-safe, if
you're
> allowing concurrent calls into JFFS2 -- which I think we are; open and
> close are serialised but read() and write() on two separate files can
> happen simultaneously AFAICT.
[...]

Effectively, before any call to a file system function, the macro
LOCK_FS is called. This macro is an alias to cyg_fs_lock.
Accordig to the flag passed to that function (ie :
CYG_SYNCMODE_FILE_FILESYSTEM) file system functions are serialized that
way.

But it seems that read() and write() lead to a cyg_file_lock which call
cyg_fs_lock (see fd.cxx).

So, read() and write() are probably serialized to.

Am I wrong?

Regards.

Vincent


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

  parent reply	other threads:[~2003-11-27 17:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-26  9:15 Vincent Catros
2003-11-27  0:27 ` David Woodhouse
2003-11-27  9:12   ` [ECOS] RE : " Vincent Catros
2003-11-27  9:36     ` [ECOS] " David Woodhouse
2003-11-27 10:00       ` [ECOS] RE : " Vincent Catros
2003-11-27 10:24         ` [ECOS] " David Woodhouse
2003-11-28 11:14     ` [ECOS] " David Woodhouse
     [not found]       ` <1070018876.10048.35.camel@hades.cambridge.redhat.com>
2003-11-28 16:09         ` David Woodhouse
2003-11-29 14:54           ` Gary Thomas
2003-11-29 15:46             ` David Woodhouse
2003-11-29 15:47           ` Nick Garnett
2003-11-29 19:40             ` David Woodhouse
2003-11-27 17:02   ` Vincent Catros [this message]
2003-11-28 11:09     ` [ECOS] " David Woodhouse

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='000e01c3b508$b6f34d30$7407a8c0@figuier' \
    --to=vincent.catros@elios-informatique.fr \
    --cc=dwmw2@infradead.org \
    --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).