Threads (handlers) issue

  • Thread starter Thread starter csharpula csharp
  • Start date Start date
C

csharpula csharp

Hello,
I got the following question , part of my future application I will run
number of threads according to number of enteries in input xml file. How
can I dynamically build handlers which will wait for those threads if I
don't know before the runtime how many threads will be?

Thank u!
 
csharpula csharp said:
I got the following question , part of my future application I will run
number of threads according to number of enteries in input xml file. How
can I dynamically build handlers which will wait for those threads if I
don't know before the runtime how many threads will be?

What exactly do you mean by "handlers"? Consider how you'd do it if you
knew to start with that you'd use 15 threads. Once you know that, it
will probably be easy to take 15 and make it n.
 
I don't know how many threads will be,it depends on my xml input. How
can I deal with it?
 
csharpula csharp said:
I don't know how many threads will be,it depends on my xml input. How
can I deal with it?

As I said, work out how you'd handle it if you *do* know how many
threads it'll be - taking 15 as an example - then adapt it so that you
can pass in the number of threads as a parameter.

What would you do with 15 threads?
 
But the question is if I can dynamcally create handlers for each
upcoming thread and if this is not a problematic issue?
 
csharpula csharp said:
But the question is if I can dynamcally create handlers for each
upcoming thread and if this is not a problematic issue?

Well, you still haven't said what you mean by a "handler", but yes you
can create threads dynamically. It's not a problem so long as you work
out what you actually want to do with the threads.
 
My aim to create as much threads as will be in input and to get the
result for each one of them. How can I create dynmically those functions
which will check the thread results?
 
My aim to create as much threads as will be in input and to get the
result for each one of them. How can I create dynmically those functions
which will check the thread results?

Well, it's more likely that the threads will each feed results to some
central pot.

However, I *strongly* suggest you just write some prototype code with
a fixed number of threads. I really think you'll find you just don't
have the problem you're anticipating.

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Threads problems 2
Two worker threads using one queue 3
"Global" thread-safty in sharepoint / WS 3.0 6
threads 1
threading question 3
Threading a server 8
Simple TCP Server - String Bulding Problem 3
Thread 1

Back
Top