[zeromq-dev] [zeromq/2.0 - beginner's question] why do I get a seg fault?

Martin Sustrik sustrik at 250bpm.com
Tue Nov 17 10:21:24 CET 2009

Hi Matias,

> I discovered ZeroMQ while looking at a lightweight AMQP implementation ;
> how version 2.0 relates to AMQP ? Is it still AMQP, or did you decide to
> move away from it ?

We've moved away from AMQP as the protocol itself is designed in such a 
way that it doesn't allow for real high-perf messaging. The original 
goal of AMQP was to replace proprietary messaging protocols in SOA & EAI 
space, the need for high-perf never really came into focus and thus it 
lacks such obvious features like support for multicast, message batching 

> (I am new to messaging systems, sorry if my questions look weird - by the
> way, what do you think of something like Spread for example ? I plan to
> test this as well)

It depends on what your requirements are. You should expect 0MQ to be 
something like 10-100x faster than Spread. Still, you may find Spread 
more functionally complete.

> I confirm that I don't have zmq_pollitem_t in my zmq.h file ; I just 
> downloaded
> the tarball from zeromq.org, on the 0MQ/2.0 section. Maybe I should get the
> very latest source from github ?

Oops. Sorry. I haven't noticed you are using alpha3. So yes, download 
the latest version of zeromq2 from github to get poll working.

Btw, I gave your example program a thought and my feeling is that the 
best way to handle this kind of thing is to break non-blocking calls 
(send, recv, poll) when signal arrives the same way that POSIX sockets 
do, i.e. to return EINTR error code. That way you'd be able to check 
whenther Ctrl+C have arrived and terminate your application neatly.


More information about the zeromq-dev mailing list