On Saturday 11 August 2007 05:34, Andrew Piskorski wrote:
> On Thu, Aug 09, 2007 at 01:04:06PM -0700, Tom Jackson wrote:
> > Subject: Re: [AOLSERVER] aolserver focus
> >
> > There are certain things which seem difficult in AOLserver, maybe
> > more difficult than they should be, but maybe not.

> Tom, can you elaborate on the difficulty of creating the AOLserver C
> module?  Is it just the pointer stuff you mention below?
> > The difficulty seems to be in using the Tcl C API to
> > make a place to store application data, like handle pointers, etc.
> What did you use to do it?

In general, everything the library works with by passing around needs a 
hashtable, or you need to package up the various steps into a single Tcl API. 
In either case, there is a lot of work at using the API. Not that this is 
unusual. Maybe it would be better to find a C application which uses the API 
and try to integrate that into a module instead. The main difficulty is 
really the lack of good examples, or any talk or discussion on the subject 
(at least here). This isn't a complaint. Discussing C code isn't high on my 
list, but the AOLserver C API is also valuable. If we are looking at Apache, 
we need to remember that one selling point of Apache to new application 
developers is the APR: a runtime API which is actually separate from Apache 
httpd. We tend to push the final product AOLserver, not the thing which new C 
developers would be really interested in. They might be interested in the add 
on scripting which you get with Tcl. If their application is at all concerned 
with networking or threading, why not go with a higher level API in 
AOLserver? Then the particular AOLserver which we load as nsd, becomes a 
smaller application of the underlying API. Maybe this isn't possible.

> I didn't have too many different types of pointers and such to worry
> about, but following the example of some other AOLserver C code, I
> used Tcl hash tables (Tcl_FindHashEntry, Tcl_GetHashValue, etc.) to
> store process-wide pointers or other values.  It wasn't rocket
> science, but that did seem rather low level and fiddly.

What is gained by going with an AOLserver module over just writing a Tcl 
package based upon the library, then loading in AOLserver? Unless we are 
using AOLserver specific stuff which can't be loaded with libnsd, is there a 
benefit? Maybe the an updated howto, list of ideas for C module development?

> For some other strictly per-thread C stuff, I used AOLserver's thread
> local storage C APIs (Ns_TlsGet, Ns_TlsAlloc, etc.).  Those were VERY
> useful for making API-compatible drop-in replacements for certain
> non-thread-safe library functions on Solaris.

The AOLserver API solves typical problems for C developers. Why not promote 

tom jackson

AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to