Pattern Related Question .. Please help

HI All,

I am little confused on the stratergy to choose while solving a particular problem please help.

I have a list (Call it main list A) and each element in this list contains another list( different list for each different element in List A).

I need to send command to each and every element of list A in Parallel ,but the list contained in Element of A should be sent command serially.

Now the major problem is since i want to send command to the List conatined in each element of A serially ie thread sud block . But want list A sud be polled parallely . But the no of threads are increasing a lot when no of elements in A are increased .Any idea how it can be dealt.

List A :- A1, A2,A3 (These need to be worked parallely)

List of A1: B1,B2,B3 (Now these elements need to be sent command serially ie wait for response which can take 15 sec)

List of A2: C1,C2

List of A3: D1,D2,D3,D4,D5

Now I want Thread structure to be something like

MAIN

A1,A2,A3

But the main problem is the no of threads depending on the no of elements in A .

Is there any design patter to deal with it

[1168 byte] By [saurabhagarwal1981a] at [2007-10-2 7:57:06]
# 1

You statement requirements are unclear and confusing.

Java Threads are not run in parallel, they are run in time slices. So what you seem to be asking for cannot be done with Java, it can at best be simulated. In fact there are very few languages and hardware platforms that could do it.

You may find the Chain of Responsibility pattern useful for processing your sub-list in sequence.

MartinS.a at 2007-7-16 21:47:27 > top of Java-index,Other Topics,Patterns & OO Design...