[kaffe] synchronization patch for PlainDatagramSocketImpl

Dalibor Topic robilad at kaffe.org
Fri Jul 1 02:48:20 PDT 2005


jrandom wrote:
> Hi y'all,
> 
> I'm adding support for a high degree transport to i2p and noticed
> that kaffe's PlainDatagramSocketImpl synchronizes all the native
> methods, in addition to explicit locks on the receive(...) and
> send(...) queues.  This obviously b0rks anything that tries to
> use a single socket to send and receive from (one thread blocking
> on .receive, and other threads occationally calling .send), so I've
> made the attached patch removing the native object scoped
> synchronization, resolving the issue (firing up -vmdebug NATIVENET
> showed no problems either).  While I personally don't explicitly
> need all of the native calls to be unsynchronized (just the send0
> and receive0 calls), I thought it'd make sense to remove it across
> the board (unless someone out there knows why it needs to be?)
> 
> (if it matters, yes, sun's jvm works fine with a thread blocking
> on receive(...) and other threads calling send(...))

thanks! patch checked in. keep 'em coming!

cheers,
dalibor topic




More information about the kaffe mailing list