Csar already allows thread groups to be created that keep track of a compartmentalized set of concerns for that group. There needs to be a simple and easy way to spawn of a thread group, given e.g. varargs of concerns. Options for waiting for the thread group to complete should be made available.
The solution chosen was to simply create a new thread group and spawn a new thread in it. Waiting for the thread to finish can be accomplished by join(). If more control over the process is needed, one can create a ConcernedThreadGroup and manually create threads in it.
An example of how the new mechanism works is shown below:
Csar already allows thread groups to be created that keep track of a compartmentalized set of concerns for that group. There needs to be a simple and easy way to spawn of a thread group, given e.g. varargs of concerns. Options for waiting for the thread group to complete should be made available.
The solution chosen was to simply create a new thread group and spawn a new thread in it. Waiting for the thread to finish can be accomplished by
join()
. If more control over the process is needed, one can create aConcernedThreadGroup
and manually create threads in it.An example of how the new mechanism works is shown below: