This is the mail archive of the mailing list for the eCos project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Periodic activation

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.


Before posting, please read the FAQ:
and search the list archive:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]