Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can goroutine like erlang spawn process across multiple hosts transparently?

It is said that if configured erlang with cookie setting, the erlang's process could be run across different machines, and this is transparent to the caller. Is that possible for goroutine run like this?

like image 814
python Avatar asked Sep 03 '14 12:09

python


1 Answers

This is not a feature of the language, no. However, since there's no way in the language to ask about goroutines (for example, to get a thread ID or control them from a different goroutine like in some other languages), as long as you could set up transparent communication mechanisms (for example, channels that work over the network), you could create a similar effect. In fact, Rob Pike, one of the creators of Go, has toyed around in the past with a package he called "netchan" to do exactly this, but couldn't get the semantics right, and so he hasn't published a finalized version yet. It's definitely something he's still interested in, though, and would certainly be consistent with the Go approach to abstraction.

like image 93
joshlf Avatar answered Sep 29 '22 07:09

joshlf