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

In this case the synchronized blocks are released by calls to Object.wait, so that code would not deadlock with normal threads.

The issue is that Object.wait doesn't suspend virtual threads, so you get deadlocks. The answer is to reimplement usages of the wait/notify pattern to use locks or concurrent collections (for example, using a concurrent message queue for the producer/consumer pattern, which is a common use case for synchronized/wait/notify).



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

Search: