Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] Re: libpgtcl.dll for Windows

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Constantin Teodorescu <teo(at)flex(dot)ro>
Cc: Pgsql-Interfaces <pgsql-interfaces(at)postgreSQL(dot)org>, PostgreSQL Hacker <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [INTERFACES] Re: libpgtcl.dll for Windows
Date: 1998-12-08 14:58:46
Message-ID: 8330.913129126@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-interfaces
Constantin Teodorescu <teo(at)flex(dot)ro> writes:
> Joost Kraaijeveld wrote:
>>>> PS. A lot of people are asking me if there is a libpgtcl.dll for M$
>>>> Windows. The pgtcl package, written in pure Tcl/Tk is working but it's
>>>> very slooooow. Is there any chance that someone could try to port the
>>>> libpgtcl library for Windows ?

>> I tried but the functions
>> Tcl_CreateFileHandler(/usr/src/pgsql/src/interfaces/libpgtcl/pgtclId.c:679)
>> and Tcl_DeleteFileHandler
>> (/usr/src/pgsql/src/interfaces/libpgtcl/pgtclId.c:701) were removed for
>> non-Unix platforms as of tcl/tk8.0b1 (or thereabouts).

OK, I'm to blame for that code...

> I don't know where that functions are used, but if they are used in
> functions concerning large objects,

Large objects aren't the issue; support for async NOTIFY is.  The
comments at the head of pgtclId.c explain:

  Another headache is that Ousterhout keeps changing the Tcl I/O interfaces.
  libpgtcl currently claims to work with Tcl 7.5, 7.6, and 8.0, and each of
  'em is different.  Worse, the Tcl_File type went away in 8.0, which means
  there is no longer any platform-independent way of waiting for file ready.
  So we now have to use a Unix-specific interface.  Grumble.

  In the current design, Pg_Notify_FileHandler is a file handler that
  we establish by calling Tcl_CreateFileHandler().  It gets invoked from
  the Tcl event loop whenever the underlying PGconn's socket is read-ready.
  We suck up any available data (to clear the OS-level read-ready condition)
  and then transfer any available PGnotify events into the Tcl event queue.
  Eventually these events will be dispatched to Pg_Notify_EventProc.  When
  we do an ordinary PQexec, we must also transfer PGnotify events into Tcl's
  event queue, since libpq might have read them when we weren't looking.

If anyone can explain to me a platform-independent way of waiting for
socket-read-ready under Tcl 8.0, I'd gladly incorporate it.

I suppose the other alternative is to insert a bunch of "#ifdef WIN32"
code to provide a platform-specific implementation of this functionality
for Windows.  But I'm not sure what that would be, and I'm in no
position to write or test it anyway.  Volunteers?

(If you don't need NOTIFY functionality, it'd probably be possible
just to #ifdef out the filehandler and associated setup code... but
I don't see that as a reasonable solution for general use.)

			regards, tom lane

Responses

pgsql-hackers by date

Next:From: Oleg BartunovDate: 1998-12-08 15:00:21
Subject: problem compiling with egcs 1.1.1
Previous:From: Thomas G. LockhartDate: 1998-12-08 14:21:32
Subject: Re: [HACKERS] Date/time on glibc2 linux

pgsql-interfaces by date

Next:From: Sergio KesslerDate: 1998-12-08 15:14:44
Subject: Re: [INTERFACES] bug in ODBC driver ?
Previous:From: Peter T MountDate: 1998-12-08 08:58:31
Subject: Problems

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group