Hi Peter (and Orocos developers),
one more doubts about the internals of RTT that the documentation
doesn't explain.
Consider the Operation with callback executed in the OwnThread.
It is stated in table 2.1 that it is thread-safe without using any
lock mechanism.
Therefore, I suppose that the callback of the Operation is never
executed concurrently with updateHook, otherwise we might need locks
or something live the lockfree data struct of the DataFlow interface.
I GUESS that the method associated with an operation are called
between one updateHook() execution and the following one.
If the task is periodic, we have the guaranty that once per period the
handles of he Operations are executed, but what if the task of the
server is NOT periodic and it has a blocking function inside the
updateHook()?
Shall I suppose that the methods are NOT executed and all the clients
that used Call remain blocked?
Operations and locks
On Mon, Jun 6, 2011 at 11:46 AM, Davide Faconti
<davide [dot] faconti [..] ...> wrote:
> Hi Peter (and Orocos developers),
>
> one more doubts about the internals of RTT that the documentation
> doesn't explain.
>
> Consider the Operation with callback executed in the OwnThread.
> It is stated in table 2.1 that it is thread-safe without using any
> lock mechanism.
> Therefore, I suppose that the callback of the Operation is never
> executed concurrently with updateHook, otherwise we might need locks
> or something live the lockfree data struct of the DataFlow interface.
> I GUESS that the method associated with an operation are called
> between one updateHook() execution and the following one.
> If the task is periodic, we have the guaranty that once per period the
> handles of he Operations are executed, but what if the task of the
> server is NOT periodic and it has a blocking function inside the
> updateHook()?
>
> Shall I suppose that the methods are NOT executed and all the clients
> that used Call remain blocked?
Yes. It's exactly what the semantics of 'call' mean: remain blocked until the
server finished your request, ie, willing to wait for result. Use
'send' if you can't
wait.
It's the server's responsibility to leave updatehook at regular
intervals to process
client requests. Ie, it's quality of service, fully determined by the
component that
implements the operation.
Peter