13
45
Fork
You've already forked fibers
10

Make work stealing from other schedulers optional #41

Open
D4ryus wants to merge 1 commit from D4ryus/optional-work-stealing into master
pull from: D4ryus/optional-work-stealing
merge into: guile:master
guile:main
guile:revert-110-wip-cancel-timer-operations
guile:fdless-draft
guile:pr-60-adjust
guile:more-operations
guile:timer-wheel
guile:cross
guile:nice-dynamic-wind-experiment
D4ryus commented 2020年07月11日 11:09:36 +02:00 (Migrated from github.com)
Copy link

When working with multiple fibers and ports, disabling work-stealing
makes it easier to ensure only one thread is accessing a given port.
E.g. this allows a fiber to spawn additional fibers to access a port
without running into issues.

When working with multiple fibers and ports, disabling work-stealing makes it easier to ensure only one thread is accessing a given port. E.g. this allows a fiber to spawn additional fibers to access a port without running into issues.
emixa-d commented 2023年09月04日 14:54:57 +02:00 (Migrated from github.com)
Copy link

What issues would these be? Is this for performance only (cache locality etc.), or any bugs?

What issues would these be? Is this for performance only (cache locality etc.), or any bugs?
D4ryus commented 2023年09月04日 20:08:29 +02:00 (Migrated from github.com)
Copy link

Ran into bugs when multiple threads accessed the same port, but i don't remember the details, sorry.
Guile ports changed a lot since this PR was opened, it might be obsolete by now.
Feel free to close it if there is no interest in making work stealing optional.

Ran into bugs when multiple threads accessed the same port, but i don't remember the details, sorry. Guile ports changed a lot since this PR was opened, it might be obsolete by now. Feel free to close it if there is no interest in making work stealing optional.
emixa-d commented 2023年09月18日 09:27:30 +02:00 (Migrated from github.com)
Copy link

When working with multiple fibers and ports, disabling work-stealing makes it easier to ensure only one thread is accessing a given port.
Ran into bugs when multiple threads accessed the same port, but i don't remember the details, sorry.

How about implementing CPU pinning (https://en.wikipedia.org/wiki/Processor_affinity) instead (the strict version, not the ‘can also move to other CPU/core/whatever)? It avoids the implementation detail that is work-stealing, is more general (you could assign multiple fibers to the same (or different) CPU/core/..., whereas with this implementation you need to be lucky that multiple fibers have the same/different CPU/core/...) and is known (outside Fibers) to occasionally be useful ...

Basically the same thing as the current implementation, except that ‘work-stealing?’ becomes a per-fibers flag, ‘spawn-fiber’ gains an extra option indicating it should be strict about the scheduler choice and run-fibers gains an option to bind the schedulers to specific CPUs/cores/whatever.

>When working with multiple fibers and ports, disabling work-stealing makes it easier to ensure only one thread is accessing a given port. > Ran into bugs when multiple threads accessed the same port, but i don't remember the details, sorry. How about implementing CPU pinning (https://en.wikipedia.org/wiki/Processor_affinity) instead (the strict version, not the ‘can also move to other CPU/core/whatever)? It avoids the implementation detail that is work-stealing, is more general (you could assign multiple fibers to the same (or different) CPU/core/..., whereas with this implementation you need to be lucky that multiple fibers have the same/different CPU/core/...) and is known (outside Fibers) to occasionally be useful ... Basically the same thing as the current implementation, except that ‘work-stealing?’ becomes a per-fibers flag, ‘spawn-fiber’ gains an extra option indicating it should be strict about the scheduler choice and run-fibers gains an option to bind the schedulers to specific CPUs/cores/whatever.
civodul closed this pull request 2026年03月30日 20:28:11 +02:00
civodul reopened this pull request 2026年04月05日 18:07:45 +02:00
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin D4ryus/optional-work-stealing:D4ryus/optional-work-stealing
git switch D4ryus/optional-work-stealing

Merge

Merge the changes and update on Forgejo.
git switch master
git merge --no-ff D4ryus/optional-work-stealing
git switch D4ryus/optional-work-stealing
git rebase master
git switch master
git merge --ff-only D4ryus/optional-work-stealing
git switch D4ryus/optional-work-stealing
git rebase master
git switch master
git merge --no-ff D4ryus/optional-work-stealing
git switch master
git merge --squash D4ryus/optional-work-stealing
git switch master
git merge --ff-only D4ryus/optional-work-stealing
git switch master
git merge D4ryus/optional-work-stealing
git push origin master
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
guile/fibers!41
Reference in a new issue
guile/fibers
No description provided.
Delete branch "D4ryus/optional-work-stealing"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?