From: Colin M. <co...@fi...> - 2001-01-19 23:46:09
|
> Cool - did you have to create and event source and all that to get > proper integration with the Tcl event loop? No, it was much simpler than that - postgresql uses a socket to communicate with the backend. I use Tcl_MakeTcpClientChannel to let tcl supervise it, set the appropriate options, and expose the postgresql C library functions needed to tcl (using Swig.) That way you can just treat it as a normal socket, as long as you let postgresql's library do the reading. I'm supposed to be at linux.conf.au, but I'll try to set up a sourceforge account for it now, and upload it. Colin. > >>>Colin McCormack said: > > > 3) If the server blocks for some other reason it can indeed starve clients > . > > > The most typical example is if you make SQL calls to a database server dir > ectly > > > from TclHttpd. Those calls will block until the SQL server returns the an > swer. > > > Right now the OraTcl and SybTcl interfaces do not really support a non-blo > cking > > > interface that will free up TclHttpd to get back into its event loop. > > > > I've got a postgresql tcl interface which doesn't block on the db server bac > kend, so 3 doesn't necessarily apply. > > > > You can have it if you want, it's GPL :) > > > > Colin. > > > > -- Brent Welch <bre...@in...> > http://www.interwoven.com > > |