Speaking of thread safety, in the APR connector, when SSL is used, it may
be possible to hit some problems if read and write are called at same time
from different threads on same socket - SSL_read and SSL_write share the
same context and apparently are not safe.

I don't know if websocket allows a thread to send messages while another
receives - it is a problem for spdy ( visible when load testing ). Servlets
are not affected. There are 2 solutions I know so far -  both of them
require setting the socket in non-blocking mode, but I found few other
small bugs in the process, it seems to take much more time than I have free.

Costin

On Thu, Mar 8, 2012 at 1:12 AM, Johno Crawford <johno.crawf...@sulake.com>wrote:

> On 2/03/2012 2:29 PM, Filip Hanik - Dev Lists wrote:
>
>> On 3/2/2012 2:13 AM, Mark Thomas wrote:
>>
>>> You can't register on a selector using another thread.
>>>>
>>> Bingo. That explains it. Is that documented anywhere?
>>>
>> I'm not sure if the java.nio documentation says it, I think it does. The
>> Selector object is not thread safe. trying to manipulate interestops and
>> selectors from multiple threads, can lead to dead locks
>>
>
> According to the docs selectors themselves are safe for use by multiple
> concurrent threads, their keys however, are not [1].
>
> What's next / left on the TODO list Mark? Anything I can help out with?
>
>
>
>> I'm off for the weekend, address the other stuff next week. Enjoy the
>> weekend!
>>
>>
> Cheers,
>
> Johno
>
> [1] http://docs.oracle.com/javase/**1.5.0/docs/api/java/nio/**
> channels/Selector.html<http://docs.oracle.com/javase/1.5.0/docs/api/java/nio/channels/Selector.html>(Concurrency)
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> dev-unsubscribe@tomcat.apache.**org<dev-unsubscr...@tomcat.apache.org>
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

Reply via email to