-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Concurrency] Task names #77609
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 names #77609
Conversation
8538eef
to
39038d8
Compare
b74c08b
to
b5be7ee
Compare
ec11380
to
55c5ae6
Compare
void *allocation = _swift_task_alloc_specific( | ||
this, sizeof(class TaskNameStatusRecord)); | ||
|
||
// TODO: Copy the string maybe into the same allocation at an offset or retain the swift string? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retaining the Swift string makes sense to me. It avoids an extra copy when the string is dynamic, and avoids any copies when it's constant. I'm not sure how inconvenient it would be to manipulate a String from the C++ side of things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, so sadly it's quite painful to make this work... we have to manually inspect flags in the String's flags and then copy or not copy accordingly... I'll try to prepare our ABI so we COULD do this but I will probably not do so in the first impl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is our LTO good enough to have the stdlib expose some minimal calls for us to use here, and have it optimize to something reasonable? (Or maybe this isn't performance sensitive enough for that to matter anyway?) We'd really want to reuse the existing String
code and treat it as an opaque value here.
dd75b00
to
b3f2b6d
Compare
d22b0b7
to
ef9e5f3
Compare
#endif | ||
// NOTE: We had to move sources touching TaskGroup addTask APIs into TaskGroup+addTask.swift.gyb | ||
// due to the build having trouble with using the generated source in the same module | ||
// rdar://145171772 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build problem nr 1, I can't figure out how to get the gyb generated file included in the module 🤔
|
||
import Swift | ||
|
||
// ==== addTask / addTaskUnlessCancelled --------------------------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gyb replaces a few thousand lines (and like 20 definitions) of addTask implementations. We still have ad hoc ones though, and I can't get the gyb result to be included in the build so there's workarounds here still
@swift-ci please smoke test |
f2b080a
to
efbbc2c
Compare
@swift-ci please smoke test |
@swift-ci please smoke test |
The build isn't still right, we still need the |
@swift-ci please smoke test |
resolves rdar://88918762 |
This reverts commit 4ab5d26.
This reverts commit 4ab5d26.
swiftlang#79562) This reverts commit 09003d6.
swiftlang#79562) This reverts commit 09003d6.
swiftlang#79562) This reverts commit 09003d6.
Work in progress on adding names to tasks.
Pending SE proposal.