From d0f8705c205c896c1b35c13c3dd7f91d1837d1ee Mon Sep 17 00:00:00 2001 From: Stephen Diehl Date: Tue, 28 Feb 2012 23:31:13 -0500 Subject: [PATCH] Notes about thread saftey of zmq.Context() --- zipline/component.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zipline/component.py b/zipline/component.py index 354118f1..8c6621d9 100644 --- a/zipline/component.py +++ b/zipline/component.py @@ -133,7 +133,14 @@ class Component(object): import zmq self.zmq = zmq + # TODO: this can cause max fd errors on BSD machines with + # low ulimits, its perfectly fine to use one Context in + # multithreaded enviroments, its only in multiprocess + # systems where this becomes needed. Add this option. + # + # http://zeromq.github.com/pyzmq/morethanbindings.html#thread-safety self.context = self.zmq.Context() + self.setup_poller() self.open()