I’ve been trying for some time to find some examples or explenations of java how to create an array of n threads that are part of some threadgroup, so if anyone knows something more please explain, thanks.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Why use ThreadGroup at all? Do you actually need it? Maybe all you really need is an ExecutorService that you can submit your runnables and callables to.
Being new, you might also want to take a look at Callable. It’s almost like a thread, except a Callable returns a value. When you submit a callable, you get back a Future object, which is like a promise to get the value from the callable.