httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Sutton <>
Subject Re: mutex in palloc
Date Fri, 12 Dec 1997 12:55:28 GMT
On Mon, 8 Dec 1997, Ben Laurie wrote:
> Ben Hyde wrote:
> > Is the critical region in palloc so narrow
> > because allocation in a given pool is never
> > done by more than a single thread?
> I haven't checked the code, but that seems like a rash assumption, if
> true.

No, it is true and valid. Each thread has its own transaction pool (called
pchild in the current source, ptrans after my recent win32-fixup patch),
so this pool is local to each thread (or fiber, in later versions).  This
pool is cleared after each connection (like pchild in the Unix
child_main). ptrans is local to child_sub_main.

The only issue is modules which make their own threads. They are then
responsible for synchronisation or using sub-pools, as Dean explained. 

I don't think it is a good idea to expand the mutual exclusion area in


View raw message