From jan@swi.psy.uva.nl  Fri Feb 25 13:12:17 2000
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id NAA16232;
	Fri, 25 Feb 2000 13:12:17 +0100 (MET)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id NAA22514;
	Fri, 25 Feb 2000 13:12:27 +0100
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: "Petr Kocmid" <pkocmid@atlas.cz>,
        "swi prolog mailing list" <prolog@swi.psy.uva.nl>
Subject: Re: libpl.dll on win32
Date: Fri, 25 Feb 2000 13:08:32 +0100
X-Mailer: KMail [version 1.0.28]
Content-Type: text/plain
References: <LOBBKIFBPIKMGOCJCAKDGEJMDEAA.pkocmid@atlas.cz>
In-Reply-To: <LOBBKIFBPIKMGOCJCAKDGEJMDEAA.pkocmid@atlas.cz>
MIME-Version: 1.0
Message-Id: <00022513122702.18410@gollem>
Content-Transfer-Encoding: 8bit

On Fri, 25 Feb 2000, Petr Kocmid wrote:

>Investigating libpl.dll architecture in Dependency
>Walker, it shows libpl dynamic library imports 
>winsock.
>
>wsock32.dll:
>ordinal 18 select
>ordinal 151 __WSDAFDIsSet
>
>I was curious why. Closer look into source shows 
>winsock select() is used 3 times at:
>
>pl-file.c(1038)
>pl-fli.c(2580)
>pl-os.c(2652)
>
>At all those places, it looks like the only purpose of 
>select() is.. timing only. Seems to me as an overkill.

The one in pl-fli.c is not used at all on Win32.  It is used
in the Unix/X11 version to deal with graphical packages, but
this works entirely different in Win32.

The one in pl-os.c is one of the alternatives to deal with
sleep/1, but on Win32 it prevers another.

The one in pl-file.c is real.  It is needed if a stream is
bound to a socket, as is achieved by the socket.pl library.

>Straightforward way to get rid of it is to #undef
>HAVE_SELECT in config/win32.h. I did that and plwin
>is working ok, having no more wsock32.dll binding in 
>libpl.dll.
>
>Am I missed something, or does it make sense to implement 
>another timing method?
>
>What about other platforms?

So, if you give up wait_for_input/3, you can do what you
did.  Otherwise you need it.

	Regards --- Jan

