[erlang-questions] multiple instances of gen_server

YC <>
Thu Oct 25 22:48:32 CEST 2007


Hi all -

can there be multiple instances of a gen_server module on the same node?  I
couldn't find the answer googling (though I probably missed it), but reading
through the source code it seems that the server process is registered by
name, so by default it appears to be a singleton.

The gen_server start template from erlang mode and programming erlang looks
like

gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).

Could it be that to enable multiple instances, instead of using ?MODULE as
the name, I pass in a different name myself and explicitly pass the name
through the API to get to the correct server?

Any insights are appreciated, thanks,
yc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20071025/24d8c23b/attachment.html>


More information about the erlang-questions mailing list