in reply to How to implement such kind of GUI - daemon cooperation?

I would base the choice of IPC mechanism on what other requirements there are:

As for the choice of mainloop, I would really try to avoid introducing POE or Glib or any other complex mechanism into a workflow element. Try to keep these as small, self-contained external programs. This makes them easily testable and also forces you to define clear boundaries and clear input and output specifications. Having multiple external processes also makes it very easy to scale up your process over more machines or CPUs.

  • Comment on Re: How to implement such kind of GUI - daemon cooperation?

Replies are listed 'Best First'.
Re^2: How to implement such kind of GUI - daemon cooperation?
by llancet (Friar) on Oct 12, 2010 at 10:03 UTC

    Currently, I'm not thinking about distribute the GUI and daemons on different machine. So I should use named pipe? Or just using process signals and a file?

    In my design, those daemons are not able to be re-configured unless they are not at "running" state. However, I think it still needs to be sychronized that configure files are written down before corresponding daemon starts.

    With out a mainloop, how can a flow daemon kept itself exist? Just by while (1) {}? However it seems while(1){} is very CPU-consuming. I don't know why...