• Welcome to Valhalla Legends Archive.
 

BNCS Chatgate Event Handler (VB 6.0)

Started by n00blar, March 24, 2003, 07:54 PM

Previous topic - Next topic

Hazard

I thought that it does. But then again I may be wrong.

-:DRivE:-

"Courage is being scared to death - but saddling up anyway." --John Wayne

Skywing

Quote from: St0rm.iD on March 30, 2003, 01:20 PM
Doesn't that require multithreading?
No.  BinaryChat uses overlapped I/O and runs everything (the GUI included) in a single thread, and supports any number of bot connections per process.

Hazard

See... never listen to me when it comes to programming.

-:DRivE:-

"Courage is being scared to death - but saddling up anyway." --John Wayne

Banana fanna fo fanna

I don't understand how that's different from select().

Skywing

Quote from: St0rm.iD on March 30, 2003, 04:30 PM
I don't understand how that's different from select().
It's completely different.  If you read the Winsock documentation, select is severely crippled under Win32.

Banana fanna fo fanna

Perhaps I'm writing in Python...;)
What exactly does overlapped I/O do though? select() for me returns a list of channels that are readable at the moment and can do non-blocking reads, I just set the select() value to 5 ms so it has a little waiting time.

Skywing

Quote from: St0rm.iD on March 30, 2003, 08:05 PM
Perhaps I'm writing in Python...;)
What exactly does overlapped I/O do though? select() for me returns a list of channels that are readable at the moment and can do non-blocking reads, I just set the select() value to 5 ms so it has a little waiting time.
Whether you are using Python or not doesn't matter if it's on Win32,  which your earlier comments suggested.

Overlapped I/O lets the system perform the I/O operations in dedicated worker threads, returning the result to you when it's completed.  In Windows NT, for the most part this is what goes on already, it's just that for example ReadFile by default waits for the I/O operation to complete.

When used with sockets, you eliminate extra copying of data, thus increasing performance.  Additionally, it removes the 64-socket limitation; you can have any number of pending overlapped operations per thread.