This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Periodic activation
- From: Andrew Lunn <andrew at lunn dot ch>
- To: "Alois Z." <alois at gmx dot at>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Mon, 22 Sep 2008 20:01:54 +0200
- Subject: Re: [ECOS] Periodic activation
- References: <20080922150855.84390@gmx.net>
On Mon, Sep 22, 2008 at 05:08:55PM +0200, Alois Z. wrote:
> Hi,
>
> I'm currently in the process of porting one of my applications to
> eCos. One function of my app needs a periodic activation. Up to now
> this is nothing unusual I would just use an alarm handler. The
> problem now is that in my periodic function I need to work on some
> data which is protected by a mutex. As I should not do this in a DSR
> the only solution I found was to activate a thread from the
> DSR. This I would do with a semaphore as suggested sometimes on the
> list.
> Is this a reasonable and efficient way to do? I don't want to add
> more overhead as already needed for the mutexes and that kind of
> stuff. Any suggestions are welcome.
This is a reasonable solution.
Another alternative is to disable scheduling to protect your data. It
depends on how long you need to protect it. While the scheduler is
locked higher priority threads would be blocked from running if they
become runnable. If you just need to access a couple of items, it is
not too bad. If you need to walk a long linked list, then you might up
set your real time operation.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss