[zeromq-dev] preparing bindings for 2.1 release?
Martin Sustrik
sustrik at 250bpm.com
Fri Oct 1 20:08:55 CEST 2010
On 10/01/2010 07:35 PM, gonzalo diethelm wrote:
>> I think that you still need to ensure a memory barrier for a socket
>> migrating between threads. Not sure what's the cheapest way to do that
>> in JNI. Maybe it would be easier to declare send()/recv()/*sockopt
>> synchronized?
>
> Do we really need to have a memory barrier at the binding level, or is
> this taken care of by the library?
It's taken care of by language runtime. If the runtime doesn't execute
memory barrier when passing an object to GC thread, the GC thread would
see garbled data and ultimately crash.
In short, you don't have to care about memory barriers.
Martin
More information about the zeromq-dev
mailing list