Results 1 to 3 of 3
- 05-21-2012, 07:20 AM #1
Member
- Join Date
- May 2012
- Posts
- 1
- Rep Power
- 0
Regarding thread creation or thread pool for 100 tasks
am creating a monitor application that can monitor 100-150 devices...Now to design a monitor application, I have two approaches:-
1)Create a thread for each of the device to monitor and each thread will ping(Using ICMP) to device to know whether the device is online or not. These threads will run indefinately to know their status after a particular time interval(say 60 seconds).
2)Create a thread pool and for each device, submit a task to a thread pool..The task is simple ping to a device.
So, in the current design, the tasks will be more than the threads in thread pool..For instance ,say there are 100 device to monitor, there will be 100 tasks to be monitored and thread pool will have say 40 threads to complete these 100 tasks.
Off course the time duration to run the next bunch of tasks will be such that to complete all the pending tasks in thread pool.
Which approach will be better?
- 05-21-2012, 07:38 AM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
Re: Regarding thread creation or thread pool for 100 tasks
Code them and see? But, first, define "better".Which approach will be better?
- 05-21-2012, 07:57 AM #3
Similar Threads
-
How do I go about implementing a self tuning thread pool?
By guest_user in forum New To JavaReplies: 2Last Post: 07-19-2011, 06:01 AM -
need help with thread pool
By crank6015 in forum New To JavaReplies: 1Last Post: 04-03-2011, 02:47 PM -
How to correctly use a fixed size thread pool?
By johann_p in forum Threads and SynchronizationReplies: 1Last Post: 09-19-2010, 02:04 AM -
Thread Count Extends Beyond Pool
By jvermast in forum Threads and SynchronizationReplies: 1Last Post: 04-01-2010, 07:47 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks