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

Add Thread Naming Support #5005

Open
jdrueckert opened this issue Apr 3, 2022 · 2 comments
Open

Add Thread Naming Support #5005

jdrueckert opened this issue Apr 3, 2022 · 2 comments
Labels
Status: Needs Investigation Requires to be debugged or checked for feasibility, etc. Topic: Concurrency Requests, issues, and changes relating to threading, concurrency, parallel execution, etc. Type: Improvement Request for or addition/enhancement of a feature

Comments

@jdrueckert
Copy link
Member

Motivation

Parallelization is nice for performance, but can complicate debugging if things go wrong.
Ideally, all our threads should have names to help us during debugging to figure out which kind of tasks are executed on a specific problematic (hanging, failing, ...) thread.

With our previous mechanisms for parallelization, i.e. the ThreadManager, it was possible to provide a name when submitting a task:

engine.getFromEngineContext(ThreadManager.class).submitTask("loadGame", () -> {...})

With the currently ongoing transition to Reactor, the question is, whether RxJava provides a similar concept.

Proposal

@keturn mentioned:

there is a subscriber Context that is useful for things like this.

and

#4839 added a GameScheduler::scheduleParallel method that takes a name which it uses in the same way as ThreadManager::submitTask did. It doesn't address future use cases where we take advantage of Flux's model for pipelines, but it suffices for one-shot Runnables like this.

Additional notes

Related PRs & Issues:

@jdrueckert jdrueckert added Status: Needs Investigation Requires to be debugged or checked for feasibility, etc. Type: Improvement Request for or addition/enhancement of a feature Topic: Concurrency Requests, issues, and changes relating to threading, concurrency, parallel execution, etc. labels Apr 3, 2022
@DarkWeird
Copy link
Contributor

We have code for resolve this issue...
But i wrote it in #4865
See GameScheduler.java and any usage

@skaldarnar
Copy link
Member

@DarkWeird That's great, and definitely something we overlooked!

Maybe we can take out (some of) the changes to GameScheduler into a smaller PR and get that merged separately. Then we can most likely call this done pretty fast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Investigation Requires to be debugged or checked for feasibility, etc. Topic: Concurrency Requests, issues, and changes relating to threading, concurrency, parallel execution, etc. Type: Improvement Request for or addition/enhancement of a feature
Projects
None yet
Development

No branches or pull requests

3 participants