[swift-evolution] Isolated and failable green threads?

Niklas Saers niklas at saers.com
Thu Jan 28 02:27:55 CST 2016


Hi all,
thank you all soo much for taking the time to make Swift such a great language, so that I get to use it smiling for all my work.

There are two concepts from Erlang that I really like:
- threads are very light-weight ([green threads][0]), and memory cannot be accessed accross threads (isolated threads)
- when a thread dies, the entire app doesn't crash, but the nearest [supervisor][1] cleans up and can re-launch a new thread

Applying this to apps written in Swift, I would expect would lead to
- fewer app crashes
- developers become more likely to architecture their app by using the [actor model][2]

I am sure these ideas are not new here, but I couldn't find a discussion on it by searching the archive. What are your thoughts on bringing isolated green threads that are allowed to crash to Swift?

Cheers

    Nik


[0]: https://en.wikipedia.org/wiki/Green_threads
[1]: http://erlang.org/doc/design_principles/sup_princ.html
[2]: https://en.wikipedia.org/wiki/Actor_model


More information about the swift-evolution mailing list