30 ms·
Thanks for the details! The question about channels stems from the fact that in pi-calculus it's possible to have different processes read from the same channel
by Zalastax 8y ago
Thanks for the details! The question about channels stems from the fact that in pi-calculus it's possible to have different processes read from the same channel - making it unsuitable for distribution. Your implementation of channels seems to be extremely similar to what I did! Keep calling it channels ;)
One thing I didn't like with the approach of storing channel messages in the mailbox is that if you use the regular receive statement you might receive a message ment for the channel. In my work I had to be very careful and use selective receive all the time. My preferred solution is to give each actor multiple inboxes so that unrelated messages don't get conflated. I haven't had time to explore this yet but if you're interested in implementing it in Inko I'll be glad to help.
- YorickPeterse 8y ago> My preferred solution is to give each actor multiple inboxes so that unrelated messages don't get conflated. This is definitely an option, and I wouldn't be surprised if we eventually end up with something like this, though I'm not sure yet how the garbage collector would handle this.
- Zalastax 8y agoMailbox types for unordered interactions require manual management of mailboxes (new/free) but the type system guarantees that you can't free a mailbox with messages still in it. Garbage collection is probably possible but it seems difficult.