Re: Winsock blocking hook problems.

From: Richard Bramante <rdb_at_ftp.com>
Date: 1996/02/13
Message-ID: <4fqufo$ak_at_lard.ftp.com>#1/1


In article <4fpegb$a5k_at_show.rop2.hitachi-cable.co.jp>,

   seto_at_rop2.hitachi-cable.co.jp (SETO Koichiro) wrote:
>In article <4fgmm9$h59_at_kane.ico.net>, db_at_stardust.com says...
 

>>never, Never, NEVER use a blocking hook in a win32 app. It's totally
>>unnecessary, since win32 is preemptively scheduled.
>
>Why not?
>Do you mean that we should not use blocking hook in a pre-emptive OS like
>Win95?
>If the OS is pre-emptive, I thought blocking will not be a problem because
>the task is scheduled non-blockingly by the OS anyway. Tell me where my
>understanding is wrong.
>
>Thanks in advance.
>
>Seto
>seto_at_rop2.hitachi-cable.co.jp

The point to remember is this: in Win16 Winsock, blocking calls are "fake" *due* to the DefaultBlockingHook(). Since the OS can't preempt the blocking operation, the blocking hook is running in the background to allow for message dispatch. So what you really have is "psuedo-blocking" and all the joyful reentrancy issues that go along with it.

For the 32-bit OS, multitasking is preemptive and blocking is "real". You can use a separate thread for a blocking recv() or whatever blocking call you're making without it grinding your system to a halt.

Hence, there is no real need for the defaultblocking hook with a 32-bit OS. You still have the option of installing your own if you want with the WSASetBlockingHook() if you want, but it is not necessary because of the other options available.

--rich Received on Tue Feb 13 1996 - 00:00:00 CET

Original text of this message