Introduction

chandru <>
Wed Sep 7 19:40:14 CEST 2005


Hi,

On 07/09/05, Saifi <> wrote:
> Hi:
> 
> I would like to introduce myself as Saifi Khan and an Erlang newbie.
> 
> While taking reading Tim Bray's blog on CMT
> http://www.tbray.org/ongoing/When/200x/2005/06/20/Threads
> I happened to read about Erlang.
> 
> I also read Joe's paper on Concurrency in Erlang at LL2.
> The concept of Concurrency as a construct is quite interesting.
> 
> Couple of queries about Slides -
> 
> Q. [Create more processes than OS supports.]
>    Does Erlang process imply threads here ?

No - an erlang node is a virtual machine which has it's own
lightweight processes. Though an erlang node can use multiple OS
threads for IO.

>    Are the processes (threads) here library managed ?
The concept of a process is at the heart of erlang.

>    Is there a documentation for the user API somewhere ?
Look in the manpage for the erlang module or the proc_lib module and
look for the spawn/3,4,5 functions.

> 
> Q. [Message Passing is "send and pray"]
>    Is it UDP based communication ?
No  - each process has it's own message queue which is part of the
heap space allocated for a process. What is meant by "send and pray"
is that when process A sends a message to process B, but there is no
automatic way for A to surely know that B has received the message. As
long as process B exists, the message is guaranteed to be inserted
into B's message queue. When both processes exist in the same erlang
node, the VM directly inserts the message into B's message queue. If B
exists on another erlang node, the message is sent via distributed
erlang to the other node and that VM inserts the message into B's
message queue.

> 
> Q. [Erlang is used in Nortel Alteon SSL Accelerator]
>    What feature has been implemented in Erlang ? Is it SSL ?
I am a user of this product so I might be wrong - but from what I know
the it uses OpenSSL for all SSL termination but erlang is used to do
"everything else" (other than the switching ofcourse).

> Q. [Things in the world don't share data]
>    Doesn't this make the program's inefficient ?
>    In C programs we have shared data among various threads ?
One of the design rules when using erlang is that you should first
write code which solves your problem elegantly. Then you should
measure the performance to see if it meets your requirements. If it
does, who cares if it is inefficient. If it doesn't, then you tweak
your implementation to share data using some built in components such
as ETS and improve your performance. Sharing data is *bad* - repeat
this mantra until you believe it :-)

> Misc questions -
> 
> Q.  Is Erlang a functional programming language ?
It is. 

> Q. What is the best class of problems to solve with Erlang ?
>      (The slides talk about soft real-time systems).
Erlang is widely in use in the telecoms and banking industry.
Basically any systems where you need fast response times, 5 nines
availability, redundancy, and distribution can benefit from using
erlang.

> Q. What class of problems *cannot* be solved using Erlang ?
>    (eg. with Java we don't do Systems programming).
Erlang isn't good at GUIs. You wouldn't want to use it to parse huge
amounts of data either. With 32 bit erlang, each erlang node can only
address 4GB of memory. So if you need databases bigger than this,
you'll have to look elsewhere. But when 64 bit erlang is ready for
prime time, this might change.

> Q. What are the new books on Erlang ?
>      (could find only one on Amazon.com)
There is a French one written by Mickael Remond besides the "red
book". Other than that, ask any question on this mailing list. It's as
good as having a book!

> I am keen to learn more about the language and have a
> C/C++/Java background.
I had a warm fuzzy feeling in my stomach when I first found erlang
after grappling with C++. :-) I'm sure you'll experience it as well.

cheers
Chandru



More information about the erlang-questions mailing list