Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about VB6 and multi core CPUs

Status
Not open for further replies.

tedsmith

Programmer
Nov 23, 2000
1,762
0
0
AU
What would happen in these circumstances?

Say I have 50 clients all calling in on different fixed ports at random to 50 indexed winsocks (1 to 50) to retrieve info from a common database.

The server has one common Sub DataArrival(Index as Interger, ByVal bytesTotal As Long), buffers are also indexed so only one client data is ever processed at one time.
You always know which client it is by the index.

With a single processor I believe you never get the situation where, when the data arrival fires, it confuses data between clients. (I have exhaustively tested this and it seems to be OK)
I would have thought a single processor can only ever be at one point in the machine code at one instant so if 2 clients call at exactly the same time, one Winsock buffer has to wait until the other is finished before Dataarrival can be processed.

But is it theoretically possible that with multi core processors two or more winsocks might fire together creating a mix of the data or one or both being lost - or does Windows take care of that with VB6 type code?

When I view processor CPU usage history on my i7 I see activity on all 8 cores on a busy vb6 app.

I realise that this would be difficult to test because the likelyhood of exact occurrences at such a gigabyte clock rates is improbably anyway.
 
The Winsock controls contain internal workers threads but your program's GUI thread processes events like DataArrival. There should be no conflicts of the type you suggest because these events are queued as they occur and get processed one at a time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top