Re: DataObjectLockFree: fix facts in doxygen

Herman Bruyninckx <[email protected]>
Newsgroups gmane.science.robotics.orocos.devel
Message-ID <[email protected]>
On Tue, 11 Dec 2012, Sébastien Barthélémy wrote:

> On Tue, Dec 11, 2012 at 3:50 PM, Herman Bruyninckx <
> [email protected]> wrote:
>
>> Anyway, the Lock Free pattern has as pre-condition for its use that there
>> are
>> maximally N clients of the data, so that it can foresee N+1 buffer spaces
>> of the shared data.
>> Did you then still find problems with the code in cases where this
>> pre-condition is satisfied?
>
>
> Yes.
>
> Among the N clients there can be only one writer. This additional
> precondition is clear from the implementation and even more clear from the
> comments at line
> 119.<http://gitorious.org/orocos-toolchain/rtt/blobs/master/rtt/base/DataObjectLockFree.hpp#line194>
> Alas, it was not documented. Worst, the doxygen claimed the contrary (see
> the truth table).
>
>
>> Since that would be a big bug, I guess.
>>
>
> I do not know if having several writers for a non-buffered data port is a
> common scenario.

It should not! Because there can be only one "owner" of a particular piece
of newly created data. But I'm all about making these "hidden assumptions"
more clear (even though they are "natural"), so thanks for your noticing
these problems!

> But it would be a hard to find one certainly, since there is no lock nor
> warning, only random data corruption.
>
> Or are you trying to add more robustness into the implementation in case
>> the pre-condition is not satisfied?
>>
>
> no, I'm just fixing the doc so that it matches the implementation.
>
> Cheers

Best regards,

Herman Bruyninckx

-- 
Orocos-Dev mailing list
[email protected]
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.