-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
reschedule queue@Sched{ workpool } = do
e <- atomicModifyIORef workpool $ \ts ->
case ts of
[] -> ([], Nothing)
(t:ts') -> (ts', Just t)
--[...]The pairs will actually be realized, because atomicModifyIORef needs them. But I suspect that atomicModifyIORef is actually overkill in this case. In particular, we only deconstruct ts; we don't have to construct any new values. I suspect, therefore, that casMutVar# can do the job more cheaply. Benchmarking will be needed to test this hypothesis.
Metadata
Metadata
Assignees
Labels
No labels