httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <>
Subject Re: Upgrade of the SNMP module for Apache 1.2.5
Date Tue, 20 Jan 1998 19:40:26 GMT
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

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

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.


On Tue, 20 Jan 1998, Ben Laurie wrote:

> Dean Gaudet wrote:
> > core.  (Yup it would be so nice if we would abstract shared memory so you
> > don't have to do all the same crud we do.  A patch for that would be
> > awesome.)
> I keep thinking about this one - the problem is that we need something
> more than just a shared memory abstraction, don't we? Unless you happen
> to want to store something that's fixed length and one-per-process, that
> is.
> Cheers,
> Ben.
> -- 
> Ben Laurie            |Phone: +44 (181) 735 0686|Apache Group member
> Freelance Consultant  |Fax:   +44 (181) 735 0689|
> and Technical Director|Email: |Apache-SSL author
> A.L. Digital Ltd,     |
> London, England.      |"Apache: TDG"

View raw message