Design phase in Erlang

Klacke klacke@REDACTED
Fri Dec 6 10:26:43 CET 2002


On Fri, Dec 06, 2002 at 04:16:26PM +0100, Inswitch Solutions - Erlang Evaluation wrote:
> Erlang Devs,
> 
> I have a procces in machine M1 which receives requests to run a state machine which I called "service". 
> N clients send a request to machine M1 to execute the service.
> 
> >From the Erlang point of view, is it a good design to have a process for each client request (N processes) ?
> 
> Viewing it from another way, the service has the same code (logic) for each client but different instances for each client (the states).
> Though, could be better to have those states for every client saved in some kind of structure and use the same code for every client by messages and recursion usage ( only 1 process) ?   N times reentrant code vs N processes.
> It'd be harder to implement but I don't know how Erlang manages the N processes (N same execution routines) in memory when a huge number of processes are running.
> 
> I'd greatly appreciate some feedback about this.
> 


One process (or more) per client is the way to go.


/klacke


-- 
Claes Wikstrom                        -- Caps lock is nowhere and
Alteon WebSystems                     -- everything is under control          
http://www.bluetail.com/~klacke      
cellphone: +46 70 2097763



More information about the erlang-questions mailing list