On Thursday 13 May 2010 21:28:21, Aran Donohue wrote:
> 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?

    t <- getCPUTime
    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
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to