Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Concurrency] Task Local Values #34722

Merged
merged 7 commits into from Feb 14, 2021
Merged

[Concurrency] Task Local Values #34722

merged 7 commits into from Feb 14, 2021

Conversation

ktoso
Copy link
Member

@ktoso ktoso commented Nov 13, 2020

Initial implementation for Task Local Values (pitch thread)

  • use the task local allocator
  • remove the iostream usage
  • add throwing overloads
  • skip tasks during lookups which do not "contribute" any values; this should naturally fall out of the linking model
  • attempt implementation without having to spawn child tasks for changing values; we can do this by treating the links as a stack on which we add and pop bindings as we enter scopes; a scope must only remember how many values it has bound and then we can pop them as we exit

rdar://67036782

@ktoso ktoso marked this pull request as draft November 13, 2020 11:04
@ktoso ktoso changed the title [Concurrency] Task Local Values experiments [Discussion][Concurrency] Task Local Values experiments Nov 13, 2020
@ktoso ktoso changed the title [Discussion][Concurrency] Task Local Values experiments [Discussion][Concurrency] Task Local Values Dec 16, 2020
include/swift/ABI/Task.h Outdated Show resolved Hide resolved
include/swift/ABI/Task.h Outdated Show resolved Hide resolved
@ktoso ktoso changed the title [Discussion][Concurrency] Task Local Values [WIP][Concurrency] Task Local Values Dec 16, 2020
include/swift/ABI/Task.h Outdated Show resolved Hide resolved
include/swift/ABI/Task.h Outdated Show resolved Hide resolved
include/swift/ABI/Task.h Outdated Show resolved Hide resolved
include/swift/ABI/Task.h Outdated Show resolved Hide resolved
include/swift/ABI/Task.h Outdated Show resolved Hide resolved
include/swift/Runtime/Concurrency.h Outdated Show resolved Hide resolved
stdlib/public/Concurrency/TaskLocal.swift Outdated Show resolved Hide resolved
include/swift/ABI/Task.h Outdated Show resolved Hide resolved
@ktoso
Copy link
Member Author

ktoso commented Dec 17, 2020

@swift-ci please smoke test

@ktoso ktoso changed the title [WIP][Concurrency] Task Local Values [Concurrency] Task Local Values Dec 21, 2020
@ktoso
Copy link
Member Author

ktoso commented Dec 21, 2020

This is now PoC complete, however creates many child tasks and does not apply the optimizations for skipping through empty tasks; I'll implement this shortly.

@ktoso
Copy link
Member Author

ktoso commented Jan 7, 2021

@swift-ci please smoke test linux

@ktoso ktoso force-pushed the wip-tasklocals branch 2 times, most recently from 2562391 to f5d6082 Compare January 7, 2021 14:13
@ktoso
Copy link
Member Author

ktoso commented Jan 8, 2021

@swift-ci please smoke test linux

@ktoso
Copy link
Member Author

ktoso commented Jan 13, 2021

Ok with the LLVM fix merged this should work now...?

@ktoso
Copy link
Member Author

ktoso commented Jan 13, 2021

@swift-ci please smoke test

@ktoso
Copy link
Member Author

ktoso commented Feb 10, 2021

@swift-ci please smoke test

@ktoso ktoso force-pushed the wip-tasklocals branch 5 times, most recently from 190d743 to 2799b72 Compare February 11, 2021 03:42
@ktoso
Copy link
Member Author

ktoso commented Feb 11, 2021

@swift-ci please smoke test

@ktoso
Copy link
Member Author

ktoso commented Feb 11, 2021

LLVM fixed again 🥳

This should be good to go if tests pass, will pitch and address all upcoming feedback as we get more experience with using those in practice.

@ktoso
Copy link
Member Author

ktoso commented Feb 12, 2021

@swift-ci please smoke test

@ktoso
Copy link
Member Author

ktoso commented Feb 13, 2021

@swift-ci please smoke test and merge

@ktoso
Copy link
Member Author

ktoso commented Feb 14, 2021

@swift-ci please smoke test

@ktoso
Copy link
Member Author

ktoso commented Feb 14, 2021

@swift-ci please test windows

@ktoso ktoso merged commit e6af501 into apple:main Feb 14, 2021
@ktoso ktoso deleted the wip-tasklocals branch February 14, 2021 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants