79676989

Date: 2025-06-24 04:07:30
Score: 1.5
Natty:
Report link

Marking a thread a daemon thread means it is just a helper thread of thread which created it. As @holger has explained VT are created and removed cheaply. Virtual Thread(s) are mounted on some platform thread in some sort of waiting list (that platform thread may be single). These daemon Virtual Threads are moved back and forth from platform thread (they are mounted upon) to heap memory and again to platform thread (when blocking resource is available). They are just there to help. Thus they are daemon by default. If the platform thread dies, no point in waiting for Virtual threads, in fact they will be auto cleaned due to Structured Concurrency.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • User mentioned (1): @holger
  • Single line (0.5):
Posted by: JPG