Angus Robertson - Magenta Systems Ltd wrote:
>> However the speed depends of course, if you have just a single
>> instance, it makes no difference, but how do you realize multiple,
>> concurrent i.e. FTP-dowloads in sync mode? You would have to go
>> multithreaded, pooled or
>> one thread per connection but that's definitely slower than having
>> multiple instances in a single thread.
> 
> Again not necessarily, I trigger activities off a timer and messages,

OK - that would do it thanks to none-blocking sockets and the new
wait-functions (MsgWaitForMultpleObjects), but sounds more
complicated to me than simply using the async methods.
But as you already mentioned before, it's sure a question of programming and
personal taste. When I started with ICS I also began to think event-driven
which took me a while until I fully adapted the principle, but today I love
it. The event-concept helps me also to avoid writing never ending
spagetti-code :)

> and so a sync FTP download does not stop the time running other things
> at the same time, provided any 'waits' are calling ProcessMessages to
> keep things moving (and there are no sleeps). 

Do you say that you are convinced MsgWaitForMultpleObjects() is faster than
Sleep()and ProcessMessages; ;-)  

> I only use threads for
> pings, since they are blocking.  One application is doing once a second
> async comms at the same time as sync FTP downloads.
> 
> I don't disagree that use of async events is better, particularly for
> servers, and I use them for simple socket applications that don't have
> complex states.

Cheers,

Arno Garrels 

> 
> Angus

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to