Eventport callback : do I need a mutex ?

Hi,

I have several event port in my component, all are connected to a
callback (several port may be on the same callback). All those
callbacks are playing with a common ressource (let say any of my
component attribute). Do I need a mutex on the callbacks and the
updateHook ? Or is it impossible due to the component internal
architecture that 2 callbacks are called at the same time ?

Eventport callback : do I need a mutex ?

2012/4/7 Willy Lambert <lambert [dot] willy [..] ...>:
> Hi,
>
> I have several event port in my component, all are connected to a
> callback (several port may be on the same callback). All those
> callbacks are playing with a common ressource (let say any of my
> component attribute). Do I need a mutex on the callbacks and the
> updateHook ? Or is it impossible due to the component internal
> architecture that 2 callbacks are called at the same time ?

It's impossible. In the case the next event arrives before your
previous callback method is finished, executing of the next callback
is queued. AFAIK, you don't ever have to use mutexes yourself.

Steven

> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

Eventport callback : do I need a mutex ?

2012/4/7 Steven Bellens <steven [dot] bellens [..] ...>:
> 2012/4/7 Willy Lambert <lambert [dot] willy [..] ...>:
>> Hi,
>>
>> I have several event port in my component, all are connected to a
>> callback (several port may be on the same callback). All those
>> callbacks are playing with a common ressource (let say any of my
>> component attribute). Do I need a mutex on the callbacks and the
>> updateHook ? Or is it impossible due to the component internal
>> architecture that 2 callbacks are called at the same time ?
>
> It's impossible. In the case the next event arrives before your
> previous callback method is finished, executing of the next callback
> is queued. AFAIK, you don't ever have to use mutexes yourself.
>
> Steven
>
>> --
>> Orocos-Users mailing list
>> Orocos-Users [..] ...
>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

Thanks you 2 :D