Re: [AOLSERVER] ns_cache and virtual hosting ...

2003-03-16 Thread Zoran Vasiljevic
On Saturday 15 March 2003 19:28, you wrote:
 Zoran Vasiljevic wrote:
  On Saturday 15 March 2003 18:45, you wrote:
 
  Agree. I have skipped thru code and, apart from some
  typecasts, I see no problems.

 Hmmm ... I added a bunch of typecasts to avoid warnings at compile time,
 are you saying you had to add more or that you've taken some out?  Most
 were to cast int to size_t - the code uses size information as a signed
 integer in some places (-1 as a flag) so simply changing the offending
 vars to size_t caused new warnings to pop up.

I just had to add a couple.


 The warnings I was getting rid of had nothing to do with the
 functionality I added, I just dislike our having code that generates
 warnings and took the opportunity to clean it up while I was working on it.


Oh yes. This is what I usually do when looking at the code after
some time. Here/there I just define -Wall and quite often I'm
surprised with what sneaked into :-)

 I would probably take the approach of adding a new command to ns_cache,
 using servPtr == NULL as a flag seems a bit of a kludge.  Most of the
 code works on a cache pointer with no other context information,
 implementing a true global cache will just involve adding a new proc to
 use a static tcl hashtable to map the name to a cache pointer.  You
 initializing that hashtable and an associated static lock the first time
 the module is loaded, and only the first time ...

I see. Well, this is quite simple as well. I'll look into it and try to get
it in the Tcl API as transparent as possible.

Cheers,
Zoran


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] ns_cache and virtual hosting ...

2003-03-16 Thread Zoran Vasiljevic
On Sunday 16 March 2003 10:07, you wrote:

  I would probably take the approach of adding a new command to ns_cache,
  using servPtr == NULL as a flag seems a bit of a kludge.  Most of the
  code works on a cache pointer with no other context information,


Don,

Instead of adding new cmd, I changed the API (backward-compatible)
to read:

  ns_cache create name
?-size size? ?-timeout timeout? ?-thread boolean | -common boolean?

So, now we have per-thread, per-virtual-server and common caches.

The per-virtual-server is the most commonly used type, therefore it needs
no extra options.
Others are less important, thus need extra option (-thread or -common)
Note that -thread and -common are mutualy exclusive.
The name of the new option -common is the best what came to my
mind. If somebody has a better idea, please step out.

Cache name resolving is done by first looking into the
per-virtual-server caches and if none found, into  common caches.

I will commit this into SF tomorrow, after checking it with Purify
just to be sure. I'll tag it with the 1.5 version since it should also
be usable (albeit not necessary) for 3.x servers.

Cheers,
Zoran


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] ns_cache and virtual hosting ...

2003-03-16 Thread Andrew Piskorski
On Sun, Mar 16, 2003 at 02:33:53PM +0100, Zoran Vasiljevic wrote:

   ns_cache create name
 ?-size size? ?-timeout timeout? ?-thread boolean | -common boolean?

 The name of the new option -common is the best what came to my

-serverwide?  -global?

--
Andrew Piskorski [EMAIL PROTECTED]
http://www.piskorski.com


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] ns_cache and virtual hosting ...

2003-03-16 Thread Zoran Vasiljevic
On Sunday 16 March 2003 15:18, Andrew Piskorski wrote:
 On Sun, Mar 16, 2003 at 02:33:53PM +0100, Zoran Vasiljevic wrote:
ns_cache create name
  ?-size size? ?-timeout timeout? ?-thread boolean | -common boolean?
 
  The name of the new option -common is the best what came to my

 -serverwide?  -global?

-serverwide it is.

Thanks,
Zoran


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] ns_cache and virtual hosting ...

2003-03-16 Thread Zoran Vasiljevic
On Sunday 16 March 2003 16:14, you wrote:

 Yes, it will be simple, if it weren't for the fact that the OpenACS
 project's taking 100% of my time at the moment I would be more than glad
 to finish up this last remaining piece.

Well, relax ;) The work is done, at least on the ns_cache.
It is in the SF and I've made the 1.5 version in the Files section.
The new option is set to -serverwide boolean if you ever need it.

Cheers,
Zoran


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] ns_cache and virtual hosting ...

2003-03-16 Thread Don Baccus
Zoran Vasiljevic wrote:
On Saturday 15 March 2003 19:28, you wrote:

Hmmm ... I added a bunch of typecasts to avoid warnings at compile time,
are you saying you had to add more or that you've taken some out?  Most
were to cast int to size_t - the code uses size information as a signed
integer in some places (-1 as a flag) so simply changing the offending
vars to size_t caused new warnings to pop up.


I just had to add a couple.
OK ... it had compiled clean here but then again the version of gcc I
was using was relatively ancient, I haven't updated my laptop in the
three years I've had it.
I would probably take the approach of adding a new command to ns_cache,
using servPtr == NULL as a flag seems a bit of a kludge.  Most of the
code works on a cache pointer with no other context information,
implementing a true global cache will just involve adding a new proc to
use a static tcl hashtable to map the name to a cache pointer.  You
initializing that hashtable and an associated static lock the first time
the module is loaded, and only the first time ...


I see. Well, this is quite simple as well. I'll look into it and try to get
it in the Tcl API as transparent as possible.
Yes, it will be simple, if it weren't for the fact that the OpenACS
project's taking 100% of my time at the moment I would be more than glad
to finish up this last remaining piece.
--
Don Baccus
Portland, OR
http://donb.photo.net, http://birdnotes.net, http://openacs.org
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] ns_cache and virtual hosting ...

2003-03-16 Thread Don Baccus
Zoran Vasiljevic wrote:
On Sunday 16 March 2003 15:18, Andrew Piskorski wrote:

On Sun, Mar 16, 2003 at 02:33:53PM +0100, Zoran Vasiljevic wrote:

 ns_cache create name
   ?-size size? ?-timeout timeout? ?-thread boolean | -common boolean?
The name of the new option -common is the best what came to my
-serverwide?  -global?


-serverwide it is.
I agree.  -global would be confusing because of the existing
terminology in the code and documentation.
--
Don Baccus
Portland, OR
http://donb.photo.net, http://birdnotes.net, http://openacs.org
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] ns_cache and virtual hosting ...

2003-03-16 Thread Don Baccus
Zoran Vasiljevic wrote:
On Sunday 16 March 2003 16:14, you wrote:


Yes, it will be simple, if it weren't for the fact that the OpenACS
project's taking 100% of my time at the moment I would be more than glad
to finish up this last remaining piece.


Well, relax ;) The work is done, at least on the ns_cache.
It is in the SF and I've made the 1.5 version in the Files section.
The new option is set to -serverwide boolean if you ever need it.
Thanks, Zoran!

--
Don Baccus
Portland, OR
http://donb.photo.net, http://birdnotes.net, http://openacs.org
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] ns_cache and virtual hosting ...

2003-03-15 Thread Jim Wilcoxson
Are the changes such that a cache can be either per-virtual-server or
per-server?  It might be useful to retain the ability to have a
server-wide cache.

 I sat down Friday afternoon with Jim's excellent short document
 describing how to make a module virtual server aware, and after an hour
 or two ended up with a modified ns_cache that fits the bill.  The
 necessary changes were simple.  I've tested it using multiple instances
 of OpenACS and it seems to work fine.



I. To remove yourself from this list:

Send a message to [EMAIL PROTECTED]  with the following text in
the BODY of your message:

signoff aolserver

II. For a complete list of listserv options please visit:

http://listserv.aol.com/

III. For more AOLserver information please visit:

http://www.aolserver.com/


Re: [AOLSERVER] ns_cache and virtual hosting ...

2003-03-15 Thread Tom Jackson
Don,
Don,
I would agree that we don't need both options at the moment, the main
focus should be on making modules work with AOLserver 4.0, not enhancing
them.
If someone needs the global cache, they can just run the current version
no?
Can I get a copy of your code, plus any suggested config file
settings/changes?
Thanks for doing the work!

--Tom Jackson

Don Baccus wrote:

No, I didn't, my changes essentially maintain the old semantics on a
per-virtual-server basis.  It wouldn't be hard to add a server-wide
cache but I don't personally have time to work on it and it's not
something we need to virtual host multiple OpenACS sites.


I. To remove yourself from this list:

Send a message to [EMAIL PROTECTED]  with the following text in
the BODY of your message:
signoff aolserver

II. For a complete list of listserv options please visit:

http://listserv.aol.com/

III. For more AOLserver information please visit:

http://www.aolserver.com/


Re: [AOLSERVER] ns_cache and virtual hosting ...

2003-03-15 Thread Zoran Vasiljevic
On Saturday 15 March 2003 16:12, Don Baccus wrote:

 So ... my questions are simple.  Who maintains ns_cache these days?  Who
 has commit rights to CVS?  How do I get these modifications accepted?
 Should the maintainer (Rob?) review my changes?

Don,

Since I'm about to move about a dozen packages to 4.0
(we'll am just in the middle of it), I can take a look
on your ns_cache changes as well.
Just send me a tarball with your changed ns_cache version.

I must also second Jim; we should really have a
process-wide *in addition* to the per-vserver cache.

Cheers,
Zoran



I. To remove yourself from this list:

Send a message to [EMAIL PROTECTED]  with the following text in
the BODY of your message:

signoff aolserver

II. For a complete list of listserv options please visit:

http://listserv.aol.com/

III. For more AOLserver information please visit:

http://www.aolserver.com/


Re: [AOLSERVER] ns_cache and virtual hosting ...

2003-03-15 Thread Don Baccus
Jim Wilcoxson wrote:
Are the changes such that a cache can be either per-virtual-server or
per-server?  It might be useful to retain the ability to have a
server-wide cache.
No, I didn't, my changes essentially maintain the old semantics on a
per-virtual-server basis.  It wouldn't be hard to add a server-wide
cache but I don't personally have time to work on it and it's not
something we need to virtual host multiple OpenACS sites.
--
Don Baccus
Portland, OR
http://donb.photo.net, http://birdnotes.net, http://openacs.org


I. To remove yourself from this list:

Send a message to [EMAIL PROTECTED]  with the following text in
the BODY of your message:
signoff aolserver

II. For a complete list of listserv options please visit:

http://listserv.aol.com/

III. For more AOLserver information please visit:

http://www.aolserver.com/


Re: [AOLSERVER] ns_cache and virtual hosting ...

2003-03-15 Thread Don Baccus
Zoran Vasiljevic wrote:
On Saturday 15 March 2003 16:12, Don Baccus wrote:


So ... my questions are simple.  Who maintains ns_cache these days?  Who
has commit rights to CVS?  How do I get these modifications accepted?
Should the maintainer (Rob?) review my changes?


Don,

Since I'm about to move about a dozen packages to 4.0
(we'll am just in the middle of it), I can take a look
on your ns_cache changes as well.
Just send me a tarball with your changed ns_cache version.
I must also second Jim; we should really have a
process-wide *in addition* to the per-vserver cache.
I'm sure that would be nice, and if anyone has time to do it, they're
more than welcome to do so.
I don't, however, at the moment.

My goal here was to simply maintain the existing semantics for site code
written to run in the single server enivronment that's now being run in
the multiple virtual server environment.  In other words, existing site
code shouldn't break, and code which uses the current nscache will break
when multiple virtual servers are run.  I did what I need for the
OpenACS project and I have time for, unfortunately.
I don't think the fact that the functionality's not been enhanced should
cause us to hold back adopting my changes (assuming they pass
inspection, etc) - existing code won't miss enhancements it doesn't know
about.
And I might find time later - in a couple of months - to add a true
global cache if no one else gets around to it.
--
Don Baccus
Portland, OR
http://donb.photo.net, http://birdnotes.net, http://openacs.org


I. To remove yourself from this list:

Send a message to [EMAIL PROTECTED]  with the following text in
the BODY of your message:
signoff aolserver

II. For a complete list of listserv options please visit:

http://listserv.aol.com/

III. For more AOLserver information please visit:

http://www.aolserver.com/


Re: [AOLSERVER] ns_cache and virtual hosting ...

2003-03-15 Thread Zoran Vasiljevic
On Saturday 15 March 2003 18:45, you wrote:

 I don't think the fact that the functionality's not been enhanced should
 cause us to hold back adopting my changes (assuming they pass
 inspection, etc) - existing code won't miss enhancements it doesn't know
 about.

Agree. I have skipped thru code and, apart from some
typecasts, I see no problems. I will import this in
SF on Monday, if it is ok for you.


 And I might find time later - in a couple of months - to add a true
 global cache if no one else gets around to it.

I might do this while I port other modules. It should be relatively
easy to do with srvPtr = NULL. Might turn out to be a trivial task.

Cheers,
Zoran



I. To remove yourself from this list:

Send a message to [EMAIL PROTECTED]  with the following text in
the BODY of your message:

signoff aolserver

II. For a complete list of listserv options please visit:

http://listserv.aol.com/

III. For more AOLserver information please visit:

http://www.aolserver.com/


Re: [AOLSERVER] ns_cache and virtual hosting ...

2003-03-15 Thread Don Baccus
Zoran Vasiljevic wrote:
On Saturday 15 March 2003 18:45, you wrote:

Agree. I have skipped thru code and, apart from some
typecasts, I see no problems.
Hmmm ... I added a bunch of typecasts to avoid warnings at compile time,
are you saying you had to add more or that you've taken some out?  Most
were to cast int to size_t - the code uses size information as a signed
integer in some places (-1 as a flag) so simply changing the offending
vars to size_t caused new warnings to pop up.
The warnings I was getting rid of had nothing to do with the
functionality I added, I just dislike our having code that generates
warnings and took the opportunity to clean it up while I was working on it.
I will import this in
SF on Monday, if it is ok for you.
Sure.

I might do this while I port other modules. It should be relatively
easy to do with srvPtr = NULL. Might turn out to be a trivial task.
I would probably take the approach of adding a new command to ns_cache,
using servPtr == NULL as a flag seems a bit of a kludge.  Most of the
code works on a cache pointer with no other context information,
implementing a true global cache will just involve adding a new proc to
use a static tcl hashtable to map the name to a cache pointer.  You
initializing that hashtable and an associated static lock the first time
the module is loaded, and only the first time ...
--
Don Baccus
Portland, OR
http://donb.photo.net, http://birdnotes.net, http://openacs.org


I. To remove yourself from this list:

Send a message to [EMAIL PROTECTED]  with the following text in
the BODY of your message:
signoff aolserver

II. For a complete list of listserv options please visit:

http://listserv.aol.com/

III. For more AOLserver information please visit:

http://www.aolserver.com/


Re: [AOLSERVER] ns_cache and virtual hosting ...

2003-03-15 Thread Don Baccus
Tom Jackson wrote:
Don,

I would agree that we don't need both options at the moment, the main
focus should be on making modules work with AOLserver 4.0, not enhancing
them.
If someone needs the global cache, they can just run the current version
no?
Can I get a copy of your code, plus any suggested config file
settings/changes?
If you need it before Monday (when Zoran will import it into
SourceForge) let me know and I'll send it to you.  No config file
changes are required, it's totally transparent.  In essence I tested
this by pasting two existing AOLserver config scripts for two OpenACS
test sites into one config script, ran AOLserver with the result and
both sites came up with no problem.
--
Don Baccus
Portland, OR
http://donb.photo.net, http://birdnotes.net, http://openacs.org


I. To remove yourself from this list:

Send a message to [EMAIL PROTECTED]  with the following text in
the BODY of your message:
signoff aolserver

II. For a complete list of listserv options please visit:

http://listserv.aol.com/

III. For more AOLserver information please visit:

http://www.aolserver.com/