>> I think that making TaskGroup a Group was a mistake on my part. There is no 
>> need to ensure uniqueness here.

Actually, it just occurred to me that uniqueness, while not strictly required, 
should certainly be encouraged. If you added the same task to a 
ParallelTaskGroup's task sequence more than once, you'd basically get 
serialized behavior, since only one thread could run the task at a time. So 
perhaps a Group is actually appropriate.

Further, it occurred to me that TaskSequence (or SerialTaskGroup) is not really 
all that useful, since it effectively executes the tasks synchronously. The 
main value of a Task (or more generally, a thread) is concurrency. Any old 
procedural code can run tasks in series.

Worse, TaskSequence executes sub-tasks by creating (or at least obtaining) a 
new thread per task, which isn't really necessary. The same results could be 
achieved by simply calling the synchronous version of execute() (the one that 
doesn't take a listener argument) on each task in the list.

So, I'm actually thinking that:

a) TaskSequence should be deprecated/removed

b) TaskGroup is actually an appropriate name  :-)

G

Reply via email to