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.
Anyway we need to test that. Julien On Sat, Nov 10, 2012 at 11:06 AM, Julien Vermillard <[email protected]>wrote: > it's not a problem of writing it's a problem of removing the interested > write ops on the socket while another thread add a request in the queue. > > > On Sat, Nov 10, 2012 at 10:58 AM, Emmanuel Lécharny > <[email protected]>wrote: > >> Le 11/10/12 10:52 AM, Emmanuel Lécharny a écrit : >> > Le 11/10/12 9:28 AM, Julien Vermillard a écrit : >> >> hmm I think the queue sync was added (by you?) because even if it's a >> >> conncurent queue, the write registration could fail if a thead write in >> >> the queue while the selector loop write it. >> > That's possible I added the lock, I don't reember, >> >> http://svn.apache.org/viewvc?rev=1210888&view=rev >> >> Thunderbird has a better memory that I do :) >> >> >> >> >> -- >> Regards, >> Cordialement, >> Emmanuel Lécharny >> www.iktek.com >> >> >
