Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I think this forum rocks it has saved my bacon many many times..."

Geography

Where in the world do Tek-Tips members come from?
tedsmith (Programmer)
7 Jul 12 8:57
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.
dilettante (MIS)
7 Jul 12 16:17
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.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close