Home | Notifications | New Note | Local | Federated | Search | Logout

Note Detail


Reply to @PuercoPop@mastodon.social
dave@dthompson@toot.cat (2026-09-25 07:16:15)
@PuercoPop generally you want to avoid locking mechanisms with actors. if there are n actors trying to perform an operation and only one should be happening at a time then you can use an additional actor that performs that task. actors process one message at a time so you're all set at that point.

---Reply--- PuercoPop@PuercoPop@mastodon.social (2026-09-25 07:23:32) @dthompson Makes sense. So in the scenario above a solution could look like the buffer actor could send a message requesting to save file to path /foo/bar. The 'saver' actor checks no-one is currently saving at the path and replies with a file-descriptor (to avoid sending the buffer contents) the buffer actor saves the file and 'returns' the file descriptor so that other actors could save the file ?
Reply

---Replies---
dave@dthompson@toot.cat (2026-09-25 09:46:13)
@PuercoPop I don't really know how it would work out in reality but in this hypothetical scenario, the saver actor doesn't have to check anything because it would do the saving on behalf of it's callers.