[Haskell-beginners] Help me with designing my daemon, please.
Michael Litchard
michael at schmong.org
Wed Sep 7 21:01:11 CEST 2011
I have a daemon I need to build, and need to work out some design
details I am having difficulty with. Here's what the design looks like
right now
When the daemon starts it creates an empty MVar and an empty TChan.
Then it listens for a usrSIG1.
when it gets one, it checks to see if the MVar is empty. If it is, it
does some stuff to fill the MVar, which is then used to pass around
state for a list of functions. These functions are always the same.
After evaluating these functions, the TChan is checked. As long as the
TChan has something in it,
it populates an MVar and the same three functions are evaluated in the
same order again.
If the MVar is full, it creates another MVar of the same type and puts
it in the TChan.
Is this a sound design? Does it prompt any questions from you? Here's
my question. If this is basically a sound design, I know I will need
use forkIO. I'm not sure where.
If this is not a sound design, please ask questions or give other
feedback so I can make changes and restore sanity.
More information about the Beginners
mailing list