A
Alvin Bruney
I have an array list of queries. The arraylist is variable, anywhere from 10
to 10000 or more. I'd like to spin threads to take chunks of 500 queries out
of that array list, no more than 10 threads (context switching reasons). if
it's less than 500 i spin only one thread.
I am having trouble building an efficient, clean implementation of this.
Clean means, i don't want to loop from 500 to 1000 if i only have 650 items,
i would like to stop at 650. Efficient means i don't want the code to be
messy - like what i have now. readable. I don't need the thread code part, i
need the looping mechanism. I have it done, but it's not clean, tight or
efficient. I know it can be done better. Efficiency also means efficiently
locking and releasing the datastructure.
See if you can help, otherwise i'll run with what i have. (I can't think
clearly now, the ax just fell here and we lost some very good folk)
to 10000 or more. I'd like to spin threads to take chunks of 500 queries out
of that array list, no more than 10 threads (context switching reasons). if
it's less than 500 i spin only one thread.
I am having trouble building an efficient, clean implementation of this.
Clean means, i don't want to loop from 500 to 1000 if i only have 650 items,
i would like to stop at 650. Efficient means i don't want the code to be
messy - like what i have now. readable. I don't need the thread code part, i
need the looping mechanism. I have it done, but it's not clean, tight or
efficient. I know it can be done better. Efficiency also means efficiently
locking and releasing the datastructure.
See if you can help, otherwise i'll run with what i have. (I can't think
clearly now, the ax just fell here and we lost some very good folk)