The memory allocation / threadDelay 0 has no effect, so it isn't that bug.
On Thursday 13 May 2010 21:28:21, Aran Donohue wrote:t <- getCPUTime
> I have an accept-loop:
>
> do (conn, _saddr) <- accept sock
> forkIO $ initializeConnection conn
>
> Which allocates memory iff accept allocates, I suppose. To test the
> theory, is there a way I can force an allocation that won't get
> optimized away?
let n = t `rem` 12345
s = sum [1 .. n]
s `seq` doSomething
could work.
Another option is to insert a
threadDelay 0
in your forever loops to enable context-switching if some other thread is
runnable.
>
> I'm not quite sure how I ought to proceed. I'm still very open to
> debugging tools and techniques I could use to approach the problem!
>
> Aran