-
Notifications
You must be signed in to change notification settings - Fork 106
Open
Description
In chat example from Chapter 12, it seems to me that there is no guarantee that when two users kick each other at the same time, only one of the kicks will succeed.
The kick operation is divided to two STM transactions (two atomically calls): one of them is in server function in runClient (at line 214), the second one is in handleMessage (at line 236). When we divide the transaction into two, we lose the atomicity, right?
Here is an example project (https://github.com/shiraeeshi/hs-parconc-chat-server) that shows how to make two concurrent kicks succeed. I added /pause, /resume, /pauseKicks, /resumeKicks commands. You can see the scenario in readme.
Metadata
Metadata
Assignees
Labels
No labels