[zeromq-dev] JeroMQ crashes application
Pieter Hintjens
pieterh at gmail.com
Tue Aug 20 21:36:53 CEST 2013
Michael, this is a common question and a blog explaining your solution
would help a lot of people IMO.
Pieter
On Aug 20, 2013 8:41 PM, "Michael Keselman" <michael.keselman at gmail.com>
wrote:
> Pieter,
>
> Java is not well equipped for a memory barrier implementation. I used
> in-memory queue (java.util.concurrent.ConcurrentLinkedQueue) with a pool of
> consumers. Each consumer is running in a separate thread with a dedicated
> socket. The consumer thread reads from the queue and send content to ZMQ.
> It works very well and doesn't add much overhead. I may explain the
> implementation in details in a blog if it make sense.
>
> Thx
>
>
> On Sun, Aug 18, 2013 at 1:29 AM, Pieter Hintjens <ph at imatix.com> wrote:
>
>> On Thu, Aug 15, 2013 at 4:52 PM, Michael Keselman
>> <michael.keselman at gmail.com> wrote:
>>
>> > At the moment I solved the problem by implementing a connection pool
>> with a
>> > number of connected sockets.
>>
>> Sounds fair; you just want to make sure there is a full memory barrier
>> when switching sockets between threads. (I've no idea how to achieve
>> this in Java, sorry.)
>>
>> -Pieter
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>
>
>
> --
> -Michael Keselman
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130820/e669b57f/attachment.htm>
More information about the zeromq-dev
mailing list