JAVA project with Docker/Kubernet

December 16, 2025 |

 


Docker with JAVA project









Read more…

[Java] - Thread A->Z

December 16, 2025 |

 


Thread


==========================================================================

Thread

Thread Circle:





==============================

Virtual Thread

Ref : 

https://docs.oracle.com/en/java/javase/21/core/virtual-threads.html#GUID-DC4306FC-D6C1-4BCC-AECE-48C32C1A8DAA

Virtual threads are lightweight threads that reduce the effort of writing, maintaining, and debugging high-throughput concurrent applications.

A platform thread is implemented as a thin wrapper around an operating system (OS) thread. A platform thread runs Java code on its underlying OS thread, and the platform thread captures its OS thread for the platform thread's entire lifetime. Consequently, the number of available platform threads is limited to the number of OS threads

Virtual Thread:
- A virtual thread is also an instance of java.lang.Thread..
- A virtual thread isn't tied to a specific OS thread.
- Virtual threads are implemented in a similar way to virtual memory.

Why Use Virtual Threads:
- Use virtual threads in high-throughput concurrent applications, especially those that consist of a great number of concurrent tasks that spend much of their time waiting.
- Virtual threads are not faster threads.







Read more…