>
>  You preallocate all the message objects in the queue. Did you 
>  investigate implementing your queues as a byte stream and using some 
>  kind of serialization on your message objects?
>
That's almost exactly what we've done.  The object in the ring buffer is a 
ByteBuffer which we copy/marshal into and out of, giving us an non-shared 
mutable state concurrency model.  We only have a single application thread 
per service and the thread transitions are to/from the threads responsible 
for network I/O.  So the service looks like: Network -> Ring Buffer -> 
Application -> Ring Buffer -> Network.  Very similar to the model used by 
Node.JS.

Mike.

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/javaposse/-/TIlMUm-ujCUJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to