Hello,
I have a small program with a form control and two threads. These two threads are identical with only difference is the first one reads the top part of the SQL table, while the other one reads bottom part. Both use the same DLL (that I include using imports statement) and instantiate the same class within their code areas. Now, I want these two threads to use dll and do the work simultaneously. But, they seem to take turns. (I have a counter on the form for both ). I see that when one starts, the other one stops. When the second starts, the first stops. How do I make both run at the same time. They use same table for reading and updating the DB.
Thanks in advance,
Noorul

Multithreading question
Anand Raman - MSFT
Regards,
Noorul
Debabrata.debroy
The simple answer is to get a multi-core or multi-CPU machine. A CPU efectively runs only one thing at a time, so multithreading on a single-core machine only makes it appear that stuff is running simultaneously. It's not.
Stephan Harper
Here is what I am doing.
I am actually sending SMS using DLL (a classical DLL written with winsock in vb6) over Short Message Peer to Peer over TCP connection.
Concurrently, I mean there would be switching involved, but two process is doing better performance than multithreaded one.
I commented out the sending part using the library, it ran very fast. So, I think its the DLL to be blamed. After sending few thousand messages, one of the thread stops and hangs the application. The socket server is multithreaded (actually an SMSC of Mobile Network). Any ideas I don't think sql connection is any problem.
Thanks,
Noorul
minhhoang
No they do not. Processes and threads cannot run concurrently on a single-core box, they run one after the other, just switching very, very fast. In any case, it is far more efficient to have as few context switches as possible, no matter what OS/platform you're on. Simply put, your misunderstanding of multithreading will get you into the same trouble on Solaris as it would on Windows.
Ideally, for best performance, any application should have one active thread per core.
__murph__