Threads, Sockets and OSX

Peter Hickman <[email protected]>
Newsgroups gmane.comp.lang.ruby.general
Message-ID <CALxYQy63Ktt3P7yH_UgCaPCH_oBM27_3N785Qfg39Yz2iAZEoA@mail.gmail.com>
I have a little app that is basically the standard threaded TCPServer with
a couple of mutexes to implement a fifo queue. When it runs it goes flat
out for 15-20 seconds and then freezes for 10-15 seconds. Everything
resumes just fine but it's a bit annoying and occasionally the freeze lasts
long enough to timeout connections to the server

My first thought was the GC was kicking in and so I have been trying to
find ways to reduce the amount of GC that needs to be done as well as
calling it when I have created or deleted structures so that it does not
accumulate a pile of work and kick in unexpectedly

This has reduced the number of times that the timeout causing freezes have
happened but not affected the other freezes and has also reduced the
throughput

This is on a MacMini with 4 CPUs and 8 GB ram

After much fiddling with data structures and the like I just decided to run
this on a Debian box with 4 CPUs and 4 GB of ram

No freezes whatsoever! Not even a little one. Throughput jumps from 500-700
puts/gets per second to 1,000 to 1,500

Where is the problem with OSX
1) Threads
2) Sockets
3) Mutexes

Anyone seen something like this before?


Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.