
10 Aug
2011
10 Aug
'11
2:16 a.m.
On Wed, Aug 10, 2011 at 6:20 AM, Max Cantor
Just curious, but might it be faster to:
replace the MVar handle with an IORef [Data.Sequence.Seq String] logs are appended with atomicModifyIORef then every n seconds, a worker thread uses atomicModifyIORef to clear the sequence and write the log messages to a handle?
this way, logging a message doesn't require taking an mvar
I have no idea if this is better, just thought i'd throw it out.
That's exactly what snap-server does in its logging code.
G
--
Gregory Collins