Igor Kovalenko wrote:
> I might be naive here, but would not proper threading model remove the need
> for fork() altogether? On both Unix and Win32? Should not be too hard to
> come up with abstraction which encapsulates POSIX, BeOS and Win32 threads...
> I am not sure how universal POSIX threads are by now. Any important Unix
> platforms which don't support them yet?
>
> This has downside of letting any bug to kill the whole thing. On the bright
> side, performance should be better on some platforms (note however, Apache
> group still can't come up with implementation of threaded model which would
> provide better performance than forked or other models). The need to deal
> with possibility of 'alien' postmaster running along with orphaned backends
> would also be removed since there would be only one process.
>
> Issue of thread safety of code will come up undoubtedly and some things will
> probably have to be revamped. But in long term this is probably best way if
> you want to have efficient and uniform Unix AND Win32 implementations.
>
> I am not too familiar with Win32. Speaking about POSIX threads, it would be
> something like a thread pool with low & high watermarks. Main thread would
> handle thread pool and hand over requests to worker threads (blocked on
> condvar). How does that sound?
Good summary. I think we would support both threaded and fork()
operation, and users can control which they prefer. For a web backend
where many sessions are a single query, people may want to give up the
stability of fork() and go with threads, even on Unix.
-- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610)
853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,
Pennsylvania19026