Tanaka Akira wrote:
> "Steve [RubyTalk]" <steve_rubytalk / shic.co.uk> writes:
>> Should I have expected this?  What would be the best way to address the 
>> problem?  I don't see why having used fork should have affected 
>> threading.  Can anyone explain?
>>     
> 1. fork doesn't copy other threads in the child process.
Thanks.

This (while obvious now) is exactly what I was overlooking... I had 
assumed that merely connecting an net/imap object to a server would not 
spawn any threads... and I was wrong.  I still don't see why the IMAP 
implementation should need to do this in my case... but by moving all 
IMAP access into the forked process the problem disappears.  It is a 
pity that I can't straightforwardly connect (and report any connection 
problems) before daemonizing - but I at least have a fix for now.

BTW - are there alternative IMAP implementations? The one in the 
standard library (apart from spawning threads which I'd prefer it 
didn't) appears to have no support for the IDLE command... which is a 
pity as such a feature would be a valuable enhancement for my purposes.