Hacker News new | ask | show | jobs
by googie 3705 days ago
I'm not familiar with Erlang. Nevertheless there are two main issues with this threading model:

1) Application memory consumption grows more than it should, because same extensions have to be loaded several times in the same application, but in separate threads;

2) Resources such as images (or any other kinds), or OO objects, cannot be transferred between threads efficiently, the only way is to serialize them to scalar representation, which then can be passed through either tsv (mentioned above) variables, or through a message to another thread - then deserialize them there. Apart from precious time which it costs, you also make a full copy of resource/object, growing memory consumption even more.

2 comments

Sockets aren't bad for serialization between threads in Tcl. Generally, a socket opened against localhost in Tcl is pretty smooth running. I have used multicast UDP sockets in anger with Tcl and it ran well.

For stuff that has to be fast, I generally reach for 'C', so I have not plumbed the depths of performance with sockets in Tcl.

Again, though, I drank the "everything is event driven" Kool-Aid years ago and it works for me.

I'm no expert with Erlang either, and thanks for the explanation. I have to look into Tcl/Tk for #1, but #2 makes sense to me now.