Skip to content

Replace ThreadLocals and add v thread ctx pooling#9

Open
franz1981 wants to merge 2 commits intovert-x3:mainfrom
franz1981:main_fix
Open

Replace ThreadLocals and add v thread ctx pooling#9
franz1981 wants to merge 2 commits intovert-x3:mainfrom
franz1981:main_fix

Conversation

@franz1981
Copy link
Copy Markdown
Contributor

No description provided.

@franz1981
Copy link
Copy Markdown
Contributor Author

@vietj Still not sure about the added test: I was expecting it to cause some external unpark, while it doesn't seem the case

scheduler.execute(() -> {
inThread.set(true);
var current = Thread.currentThread();
inThread.add(current);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I adopted this fix separately in my fork, it's an essential one

* Run a task on a virtual thread
*/
public void run(Handler<Void> task) {
assert !Thread.currentThread().isVirtual();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually expect to be able to call .run from a virtual thread all the time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants