From: Eric Wong Date: 2010-09-29T04:37:25+09:00 Subject: Re: Point me to help w/ multithreading in 1.9.2-p0 Alex Stahl wrote: > 3. Is there a theoretical maximum to the number of concurrent threads > which can be created which all access a network interface? This is > admittedly a poor theory - what might really cause a segfault in 1.9.2 > when 500 threads all try to access the network? Are you opening multiple file descriptors per thread? If you exceed 1024 file descriptors per-process, then the select() interface will overrun the buffers and segfault. You can fork() your process to get around this (and get more CPU/memory concurrency), or do all your IO over something like Rev[1] or EventMachine[2] which use epoll or kqueue. Which OS is this on? There may be some lingering pthreads portability issues for non-NPTL. Definitely talk to ruby-core about this. [1] - http://rev.rubyforge.org/ [2] - http://rubyeventmachine.com/ -- Eric Wong