Restartable sequences
Restartable sequences
Posted Jul 15, 2015 10:20 UTC (Wed) by dgm (subscriber, #49227)In reply to: Restartable sequences by riking
Parent article: Restartable sequences
Maybe another (naive?) approach would be to share a memory pointer with the kernel where the thread can publish a restart address. Say something like
set_atomic_restart(&ptr);
with ptr some memory owned by the thread big enough for a pointer. With that, an application can do
ptr=&&some_label;
when entering a critical section, and ptr=NULL; when leaving. If the scheduler needs to pre-empt the thread and finds that ptr has a non-null value, execution would restart at ptr instead of the saved IP.
Posted Jul 15, 2015 18:42 UTC (Wed)
by nix (subscriber, #2304)
[Link] (1 responses)
Posted Jul 15, 2015 19:54 UTC (Wed)
by Cyberax (✭ supporter ✭, #52523)
[Link]
Restartable sequences
Restartable sequences