Java Virtual Threads प्रीव्यू जारी
(openjdk.java.net)- महंगे OS threads के बजाय इस्तेमाल किए जा सकने वाले "हल्के user-mode threads" का implementation
→ java.lang.Thread में implementation जोड़ा गया
- मौजूदा threads की तरह लगभग समान व्यवहार करने वाले लाखों instances बनाए जा सकते हैं
→ मौजूदा JDK tools को वैसे ही इस्तेमाल करके virtual threads की debugging और profiling की जा सकती है
→ मौजूदा OS threads के implementation को बदला नहीं जाता, और न ही उन्हें अपने आप switch किया जाता है
-
Thread thread = Thread.ofVirtual().name("duke").unstarted(runnable); -
Thread.startVirtualThread(Runnable) -
Thread::isVirtualसे जाँच संभव
1 टिप्पणियां
ओहो, Actor model से इसमें क्या फर्क होगा