Architectural Suggestions for Job Queuing

John Gerard Malecki <>
Tue Apr 13 20:35:03 CEST 1999


Hi,

I hope this is the right form for a beginner's question.

Concurrent Programming and Erlang are new to me.  I have read through
the book and implemented some trivial programs.  Now I would like to
implement something useful.  I am not sure of how to best architect
these applications using Erlang and am looking for suggestions.  Also,
I am not yet familiar with all of the available libraries and so I may
be missing some big picture.  I am looking for are some productive
hints.  I want to code the applications myself.

The first application I could use would limit the number of
simultaneous jobs to run.  In particular, we have limited number of
software licenses.  I'd like to start up a server and give it a list
of jobs queues and their simultaneous limits.  Throughout the network
whenever someone wants to run job which uses one of those licenses
they communicate with the server.  If a license is not available then
the job blocks until the license is available.

I already have a program that does this written in ocaml but it uses
threads.  Although the threads solution is simple I would prefer to
not use them as threads do not allow "introspection".  I would prefer
to maintain an explicit queue.  This way the state of the queue could
be printed and all of the running and pending jobs could be printed.

As an off-shoot of the first application I would then like to write a
batch queue system.  Pretty much the only difference is that a general
batch queuing system would have a smarter server.  Furthermore that
server would invoke the job to run and not just count jobs.  I think
if i do a good job of writing the job limiter the batch queue would
not be much more complex but just more complicated.

Sorry for bothering but if anyone has any architectural ideas I'd be
very interested in reading them and experimenting with them.

PS - for more information of ocaml and threads see

   http://pauillac.inria.fr/ocaml/htmlman/node22.html



More information about the erlang-questions mailing list