shared memory in Erlang

Klacke klacke@REDACTED
Wed Jan 31 00:04:53 CET 2001


On Tue, Jan 30, 2001 at 01:33:23PM -0800, David Gould wrote:
> On Tue, Jan 30, 2001 at 09:12:44PM +0100, Karel Van Oudheusden wrote:
> > Hello,
> > 
> > 
> > Are there Erlang compilers that support shared memory between processes?
> > 
> > I do not really understand how database applications or network
> > applications can be implemented in Erlang efficiently without some kind
> > of form of shared memory.  Only providing message passing does not seem
> > to be a good choice for these kind of applications.
> 
> Erlang has a very strong process and communication model. I wonder what
> shared memory support between processes would look like in Erlang? I mean,
> what would the language need in terms of syntax and semantics to support it?
> 

I've fiddled with shared memory between different erlang nodes on the
same machine. A master node and a bunch of slave nodes,

1. Master node creates segment initiall with shmget() in
   a linked in driver.

2. Slave node attach to the segment.

3. Spinlocks in the segment itself to ensure exclusivity.

We (have used it (and dropped it)) to store SSL cached sesions
and share them between several erlang nodes on the smae machine.


/klacke


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




More information about the erlang-questions mailing list