This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: cyg_io_write from DSR ?
- From: Andrew Lunn <andrew dot lunn at ascom dot ch>
- To: Schmidt Henning Larsen <HenningLS at danfoss dot com>
- Cc: "eCos Disuss (E-mail)" <ecos-discuss at sources dot redhat dot com>
- Date: Fri, 23 May 2003 10:51:34 +0200
- Subject: Re: [ECOS] cyg_io_write from DSR ?
- References: <829F632D2F25D411B6920008C716F83103BC587C@dd01-e01.dd01.danfoss.net>
On Fri, May 23, 2003 at 10:41:47AM +0200, Schmidt Henning Larsen wrote:
> > >
> > > Can I call cyg_io_write from a DSR?
> >
> > No. It might try to block and you cannot block in a DSR.
> >
> > Andrew
> >
>
> I know that the DSR is the only one using it, so I don't block, but can it
> corrupt the inner of the scheduler?
There are other reasons it could block than simple mutual
exclusion. eg what happens when your output buffer is full? Normally
the driver blocks until the output buffer has some more space.
What you want to do is not safe. You are relying on a special set of
conditions being true in order that your system does not crash. To me
this is too risky and i would do it the proper way using a thread.
Andrew
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss