[erlang-questions] Shared memory and message passing

Corrado Santoro <>
Wed Sep 6 11:08:29 CEST 2006


Joe Armstrong (TN/EAB) wrote:
> This kind of usage is, I guess OK, if it's hidden from the
> user as part of an language implementation, but it should
> definitely not be exposed to the application programmer.
I agree! Think, for example, to two BIFs like:

put_data (Key, Value)
get_data (Key) --> Value

that can be used to perform a *safe* access to a "shared location" named 
"Key". If these functions were BIFs, they could be fast and effective.

I thought to the necessity of such a solution during the implementation 
of our Erlang-enabled robot: the issue was to obtain fresh data from 
sensors and positioning system; using message passing/rpc (together with 
some parts written in C + threads) I experienced some undesiderable 
delays. For this reason, instead of using rpc (or ets tables to hold 
shared data), I thought to the functions above.

However, after a discussion at Erlang Training&Consulting, some people 
discouraged me strongy :-))

So I've rewritten the software for the robot, removing many parts in C 
and, above all, the C threads: now the latencies are quasi-acceptable, 
and the robot works well, but I'm sure that using shared-data-access 
BIFs could improve a lot my system.

--Corrado

-- 
======================================================
Eng. Corrado Santoro, Ph.D.

University of Catania - Engineering Faculty
Department of Computer Science and
Telecommunications Engineering
Viale A. Doria, 6 - 95125 CATANIA (ITALY)

Tel: +39 095 7382380
      +39 095 7387035
      +39 095 7382365
      +39 095 7382364

VoIP: sip:

Fax: +39 095 7382397

EMail: 
Personal Home Page:
             http://www.diit.unict.it/users/csanto

NUXI Home Page:
             http://nuxi.diit.unict.it
======================================================




More information about the erlang-questions mailing list