Discussion:
Multithreading WinINET apps
(too old to reply)
Petar Popara
2006-02-02 14:55:04 UTC
Permalink
I am calling WinINET funcs from multiple threads, but the problem is that
there is no performance improvements (difference) if I have 5, 50 or 100
threads. What should I do?
Paul Baker
2006-02-02 14:57:51 UTC
Permalink
That depends on what those threads are doing!

Paul
Post by Petar Popara
I am calling WinINET funcs from multiple threads, but the problem is that
there is no performance improvements (difference) if I have 5, 50 or 100
threads. What should I do?
Petar Popara
2006-02-02 15:24:18 UTC
Permalink
Post by Paul Baker
That depends on what those threads are doing!
WinINET part of my thread makes SSL connection with some server and sends
data.

Is there some limitation in max num of concurent SSL connections or HTTP
connections?
Petar Popara
2006-02-02 15:29:52 UTC
Permalink
P.S. I'm thinking of implementing some pool of SSL connections to the server
and each thread would take and give back thread when doesn't need it any
more. Does it have any sense? Is there some similar example?
Scherbina Vladimir
2006-02-02 15:46:14 UTC
Permalink
Post by Petar Popara
P.S. I'm thinking of implementing some pool of SSL connections to the
server and each thread would take and give back thread when doesn't need
it any more. Does it have any sense? Is there some similar example?
http://www.codeproject.com/threads/cpthreadpool001.asp

I read a good answer on your question at MFC NG - the main idea is "it's not
enough to create a huge amount of threads, your application should have nice
design and implementation..."

So making a thread pool is good idea to avoid calling CreateThread each time
when you need to do something, but you should estimate, how much threads you
need, how much job should be performed, how much time threads might be idle.
I recommend you not create pool with 100 of threads instead make
estimations, draw the model in your head (or on the page) and then implement
it.

--
Vladimir
Scherbina Vladimir
2006-02-02 15:40:25 UTC
Permalink
Post by Petar Popara
Post by Paul Baker
That depends on what those threads are doing!
WinINET part of my thread makes SSL connection with some server and sends
data.
Is there some limitation in max num of concurent SSL connections or HTTP
connections?
That depends on several factors: your PC CPU, amount of RAM, bandwidth of
your internet connection, and the server.

--
Vladimir
Petar Popara
2006-02-02 15:44:34 UTC
Permalink
Post by Scherbina Vladimir
That depends on several factors: your PC CPU, amount of RAM, bandwidth of
your internet connection, and the server.
PC CPU, RAM and speed of network connection are not a problem. I have enough
of it. I will check server CPU/RAM usage now.

Thank you for a tip.
Scherbina Vladimir
2006-02-02 16:36:38 UTC
Permalink
Increasing PC CPU, RAM is not the only solution. Read
http://www.onlamp.com/pub/a/onlamp/2004/05/06/writegreatcode.html - it's
really nice article.

--
Vladimir
Post by Petar Popara
Post by Scherbina Vladimir
That depends on several factors: your PC CPU, amount of RAM, bandwidth of
your internet connection, and the server.
PC CPU, RAM and speed of network connection are not a problem. I have
enough of it. I will check server CPU/RAM usage now.
Thank you for a tip.
Loading...