Technically why is processes in Erlang more efficient than OS threads?

Posted by Jonas on Stack Overflow See other posts from Stack Overflow or by Jonas
Published on 2010-04-25T11:30:12Z Indexed on 2010/04/25 11:33 UTC
Read the original article Hit count: 376

Spawning processes seam to be much more efficient in Erlang than starting new threads using the OS (i.e. by using Java or C). Erlang spawns thousands and millions of processes in a short period of time.

I know that they are different since Erlang do per process GC and processes in Erlang are implemented the same way on all platforms which isn't the case with OS threads.

But I don't fully understand technically why Erlang processes are so much more efficient and has much smaller memory footprint per process. Both the OS and Erlang VM has to do scheduling, context switches and keep track of the values in the registers and so on...

Simply why isn't OS threads implemented in the same way as processes in Erlang? Does it have to support something more? and why does it need a bigger memory footprint?

Technically why is processes in Erlang more efficient than OS threads? And why can't threads in the OS be implemented and managed in the same efficient way?

© Stack Overflow or respective owner

Related posts about erlang

Related posts about lightweight-processes