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

Make thread executor a background thread. #570

Merged
merged 1 commit into from
Dec 8, 2021

Conversation

jamdavi
Copy link
Member

@jamdavi jamdavi commented Nov 30, 2021

The original implementation of XThread created a task on the standard TaskScheduler and did not spin up a parent thread. But instead the XThread container allowed "thread-like" operations to take place. The default TaskScheduler creates background threads by default.

When XThread was replaced with Thread it caused a real .NET thread to be created. This thread was created as a foreground thread which, when an application is terminated, will leave the application waiting on the termination of the thread.

This behavior is different than the original behavior with XThread.

Before, closing the application via Environment.Exit or letting it run to completion would kill all background threads. Now, the only way to terminate the executor thread is to call ShutdownGracefullyAsync. If the application using DotNetty was already calling ShutdownGracefullyAsync then the application would not experience any issues.

Foreground and background threads

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