Hi Gonzalo, [email protected] said: > I think it is up to the web container to spawn new threads or pool them.
Correct. Some webservers/containers using worker thread pools have a fixed size worker pool, on others it's dynamic. > Well, I have refreshed my rusty knowledge of servlets, and there is a > place to initialize 0MQ just once: the servlet's init() method (and the > corresponding destroy() method at the end): > http://en.wikipedia.org/wiki/Java_Servlet That seems like the right place. /me has little experience with Java servlets but most application containers work similarly, so the other place to do it would be in some kind of singleton object that gets initialised at "application initialisation time". > > It returns EMTHREAD error when you try to create a socket. > > Would it be conceivable to handle this in a more dynamic way? For > instance, a function to ask 0MQ how many user threads it can currently > handle, and another to increase (and maybe decrease) that number of > threads. Turning this question around, can't you ask the servlet container about what it's maximum thread pool size is and pass that to 0MQ? AFAIK most webservers/containers using a worker thread pool model have this limit fairly low. -mato _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
