WaitManager

18 views
Skip to first unread message

Robert O'Callahan

unread,
Oct 7, 2022, 1:15:36 AM10/7/22
to rr-devel
I just landed https://github.com/rr-debugger/rr/pull/3378 which introduces WaitManager, a wrapper around waitpid/waitid syscalls. The basic idea is to be able to wait for stops from any task and stash them in the WaitManager if it turns out that we don't want to process those stop(s) right now. This lets the Scheduler wait for stops from all tasks at once instead of doing one waitpid syscall per task, which doesn't scale very well for applications with large numbers of threads.

From now on, instead of calling waitpid/waitid directly, we should use WaitManager APIs to ensure that if WaitManager has cached a stop, that will be reported if applicable.

On another note, the various flags tracking task state in Task and RecordTask are really getting out of control and need to be cleaned up. I'm still thinking about how that might be done.

Rob
--
Su ot deraeppa sah dna Rehtaf eht htiw saw hcihw, efil lanrete eht uoy ot mialcorp ew dna, ti ot yfitset dna ti nees evah ew; deraeppa efil eht. Efil fo Drow eht gninrecnoc mialcorp ew siht - dehcuot evah sdnah ruo dna ta dekool evah ew hcihw, seye ruo htiw nees evah ew hcihw, draeh evah ew hcihw, gninnigeb eht morf saw hcihw taht.
Reply all
Reply to author
Forward
0 new messages