httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: Upgrade of the SNMP module for Apache 1.2.5
Date Tue, 20 Jan 1998 19:48:26 GMT
Dean Gaudet wrote:
> 
> I don't think so... what I'm imagining is just a function
> ap_shared_alloc(pool *p, size_t size) which is called only during init and
> returns a pointer to a piece of shared memory of size size, with cleanup
> in pool p.  It should return a pointer to an ap_shared_t.  Something
> like:
> 
> typedef struct {
>     void *mem;  /* offset of first byte */
>     /* possibly other stuff which is not part of the public interface */
>     /* such as int fd; for the file version */
> } ap_shared_t;
> 
> Each allocation would call shmget() or mmap() or whatever... so we'd
> actually have multiple segments.  The core would use this to allocate the
> scoreboard.
> 
> To support file-based "shared" mem you'd need
> ap_shared_get(ap_shared_t, size_t offset, size_t len) which re-reads
> the len bytes at offset.  And ap_shared_put() which re-writes them.
> These should be macro'd to nothing for the non-file case.

Hmmm... well, I suppose these would be a useful first step towards
something more general purpose.

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Mime
View raw message