In this article we will learn what is a thread groups? How to work with thread group in Java along with example programs. A thread group is a collection of threads. A thread group allows the programmer to maintain a groups of thread more effectively. To support thread groups Java provide a class named ThreadGroup available in java.lang packages. Some of the constructors available in ThreadGroups classes are: ThreadGroup(String group-names) ThreadGroup(ThreadGroup parents, String group-names) After creating a thread group using one of the above constructors, we can add a thread to the thread groups using one of the following Thread constructor: Thread(ThreadGroup
The post How to combine single threads and form a thread group in java appeared first on Coding Security.
How to combine single threads and form a thread group in java
read more
Tidak ada komentar:
Posting Komentar