yes but the problem in fact is to lock the socket write flag not  the
queue which is obviously thread safe

On 11/10/12, Emmanuel Lécharny <[email protected]> wrote:
> Le 11/10/12 8:42 PM, Julien Vermillard a écrit :
>> I think a simple spin lock would be much faster than plain java lock,
>> because we have two thread sharing short time locked resource, the thread
>> wanting to lock can loop a little it will receive the lock very quickly.
>> In
>> case of a java lock the thread will be candidate for context switching
>> and
>> I'm not sure it's a good idea for write performance.
> The ConcurrentLinkedList already use something else than a plain java
> lock (see http://www.cs.rochester.edu/u/michael/PODC96.html, which is
> the base for its implementation)
>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>

Reply via email to