java - write to socketchannel from one thread and select from other thread -


can write socketchannel 1 thread, while same socketchannel may being selected selector#select() io operations in other thread? thread-safe? or have delegate bytebuffers other thread (which selector#select() indefinitely), written socketchannel every after selector#select() calls.

also, selectionkey#interestops(int) set interest operations thread-safe? or have delegate same other thread (which selector#select() indefinitely).

yes can,in general. thread that's blocked in select() isn't using bytebuffer while it's blocked. if elsewhere, of course need synchronize, or take other measure.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -