[zeromq-dev] [PATCH] Scalability improvements for large amounts of connections

Martin Sustrik sustrik at 250bpm.com
Mon Oct 11 17:29:20 CEST 2010


On 10/11/2010 05:12 PM, Martin Lucina wrote:

> I agree that "socket migration" should be documented. However, IMHO 99.9%
> of users have no idea what a "full memory barrier" is or why they should
> care. In my opinon, migrating sockets between threads is really only
> something advanced users and binding implementers should be concerned with.
> Everyone else should just be told to use sockets from a single thread only.
>
> If you think that migrating sockets between threads has value for Joe User,
> then shouldn't we introduce an explicit API that does that? Even if all
> this hypothetical API call would do is issue a memory barrier?

It's interesting...

There are two issues involved:

1. Migrating a socket from thread A to thread B
2. Using a socket from multiple threads in parallel

The former may come handy at times. The latter is something that should 
not be done as it results in non-scalable applications. Unfortunately, 
latter can be implemented using the former (by migrating socket back and 
forth between multiple threads).

If preventing the latter is more important than encouraging the former, 
we should not document it in the docs.

Thoughts?
Martin



More information about the zeromq-dev mailing list