Skip to content

Allow library code to detect the JoinableTaskContext is not associated with Main thread #1477

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

Merged
merged 2 commits into from
Jul 17, 2025

Conversation

lifengl
Copy link
Member

@lifengl lifengl commented Jul 12, 2025

It allows library code to skip certain work under such conditions. For example to build an extensive dependency graph for dataflow dependencies, or dependencies in work queues.

The name of the property is based on an existing CreateNoOpContext method in the same class.

It is added because a library running inside both environments with and without UI thread becomes more important over the time, we want better way to optimize under both context.

Potentially, we can do further work in the JTF library itself, to reduce some data structure maintenance, because SwitchToMainThread is always non-op under such condition. For example, nestingFactories might not be maintained as it would never post any request to the factory etc.

…th main thread

It allows library code to skip certain work under such conditions. For example to build an extensive dependency graph for dataflow dependencies, or dependencies in work queues.
@lifengl lifengl requested a review from AArnott July 12, 2025 00:20
@lifengl lifengl merged commit c125fc1 into main Jul 17, 2025
6 checks passed
@lifengl lifengl deleted the dev/lifengl/allowNoMainThreadCheck branch July 17, 2025 03:12
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.

2 participants