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

Note Detail


Reply to @PuercoPop@mastodon.social
PuercoPop@PuercoPop@mastodon.social (2026-09-25 05:46:42)
@dthompson But it is tricky to determine the right level of granularity. e.j. one actor per buffer, but with multiple buffers on the same file there would need to be coordination (locks?) across actors to ensure only one is saving a buffer a given file at the same time

---Reply--- 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

---Replies---
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 ?