Multi Threading

E

edsuslen

I am using multi threading per customer ( currently 2 only ) to send
http request for data pooling / pushing.
It looks like if one thread is in process of pooling data, the other
thread is waiting until that process is finished.
I am using Utils dll with HTTPSend class to be called for http Send.
What am I doing wrong?
 
D

Daniel O'Connell [C# MVP]

I am using multi threading per customer ( currently 2 only ) to send
http request for data pooling / pushing.
It looks like if one thread is in process of pooling data, the other
thread is waiting until that process is finished.
I am using Utils dll with HTTPSend class to be called for http Send.
What am I doing wrong?

Thats a pretty wide question. Could you provide more detail? Specifically,
what makes you think that the other thread is waiting?
 
E

edsuslen

It takes about 20-25 minutes to pool file from 1st customer ( 1 big
file).
Meanwhile, second thread suppose to be sending responses for the 2nd
customer, smaller files, takes about 2-5 seconds to process, but it's
not processing them, until 1st customer's file is finished pooling.
As soon as 1st file is pooled, the other thread is quickly finished.

I am using simple threading:

Dim cls As New clsTimerThread
'Create the new thread
Dim t As New Thread(AddressOf cls.subRunningTask)
t.Start() 'Begin execution of the new thread

where clsTimerThread is calling my HTTP class.

should I use ThreadPooling instead?
Or something else?

I need both processes to be able to work in parallel.
Right now I have a filling of scalability issue.

Thanks in advance for any ideas.
 
J

John Bailo

1. A thread pool is generally used for loading similar items, here you
have two different processes, so i wouldn't use the ThreadPool class.

2. Are there any resources shared between the two processes on the two
threads? That is, could there be an object or server which is
"blocking" and forcing one thread to wait until the other has completed?
 
E

edsuslen

Both threads use the same object that is doing HTTP send.
Object is .net dll and I thought that it should be multi threaded.
May be I am mistaken?
 
J

John Bailo

It could be a singleton.

That is, even if you "multithread" if they are both using the same
object that sends messages serially they won't run in parallel.

You need to investigate that object and to see if you can open two
threads within it, or instantiate it twice (once for each thread).
 
E

edsuslen

I am instantiating at a thread level, therefore it is instantiated
twice.
To open new again on an object level sounds like overkill to me,- I
thought instantiating object is like a new thread, or am I wrong?
To create new thread every time I call an object sound like not a good
idea, or does it?
 

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


Top