Re: [tkined] Questions about my code design. . . opinions please?

P.Davan (pdavan@lucent.com)
Fri, 29 Jan 1999 16:04:58 +0000

KPlourd@dv.synetics.com wrote:
> My thoughts on positives and negatives of each type:
> Seperate process for each device:
> + The process will spend less time in code, and more time in the event
> loop.
> + The actual script to poll one device is simpler than that to poll
> multiple devices
> - Debugging information will be harder to keep track of, since they all
> write to the same debug file.
> - If I write custom logfile/debugging code to split up the information by
> process, it adds to the complexity of the code (the previous code is
> already written and tested)
> - Memory/process/system resources hog
>
> One process for all devices:
> + Debugging/Logging is much easier
> + Much less in the way of memory/process/system resources usage
> - The code may not spend enough time in the event loop, and too much time
> executing code.
>
> I'd appreciate any comments on what I have described here. Any answers to
> questions is appreciated (and requested), as are additions to my
> positives/negatives of each approach, and any other thoughts.
>
> I truly appreciate the time you take to reply,
> Robert Seeger

Hi,

Your problem is quite common in the way that you will encounter it in different
domains.

A response to your question of what is the best solution can be neither the
first nor the second. In fact it's a mix of both :
You can define a pool of process and each of this process will deal with a
certain number of agent.

The advantage of this approach is you can modify easily your configuration in
order to have for example one process per agent or one process for all agents.

The problem about trace file can be solved by using a socket on which all
processes will send the traces. You just have to create a other program which
will deal with the data and probably filter and/or print them.

Concerning the resource of the system, I don't think you will have some problems
if your ratio number of Agent / number of process is correctly set.
If you encounter some probems you still can run some process on an other machine
;-)

-- 
Patrice Davan                pdavan@lucent.com
tel: +44 (0)1666 835506
--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.