Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> What is the mechanism of suspension and resumption? They mention elsewhere that any platform thread could pick up any virtual thread so I assume they must be storing the stack somewhere.

Virtual threads are built on top of underlying delimited one shot continuations, and those store the stack. A large part of the engineering effort has been in making this as efficient as possible.

> Is there a cost transferring stacks on virtual threads across platform threads?

A stack always has to be at least partially copied to the carrier thread’s stack, and it doesn’t really matter which OS thread that is. I say partially because initially only the current stack frame will be copied as most threads will have a deep stack compared to the number of frames active in any operation likely to yield.

> Does this introduce new security implications if there are less OS level restrictions on memory access between platform threads?

The security model remains intact. A virtual thread performing some privileged operation will be privileged no matter which OS thread it is run on, and one which is not privileged will not be no matter the OS thread it runs on.

> What happens in cases where an application has user defined platform threads? How does the system determine what platform threads are available to the virtual threading system?

Virtual threads don’t just run on a random OS level thread. They run on a scheduler (commonly a fork join pool) and are effectively a series of tasks fed to that scheduler.



When the security manager is removed, the issue of privileged threads will become moot.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: