[Twisted-Python] using spread/perspective broker
bob at redivi.com
Tue Feb 15 16:02:55 EST 2005
On Feb 15, 2005, at 15:35, snacktime wrote:
>> Use one process, and any CPU intensive in a thread pool? If the CPU
>> intensive bit involves C code it will use multiple CPUs.
> There really isn't anything cpu intensive. The application is a
> simple line based protocol with ssl that accepts multiple requests per
> session to keep the ssl connection startup overhead to a minimum. It
> does some string formatting, an https POST to another server, a couple
> of database queries, and it's done. I was throwing around 100
> transactions per second at it and it wasn't even using 1% of the cpu.
> After thinking about this I've decided not to worry so much about the
> perception some people might have.
> When you say C code will use multiple cpu's, do you mean that if a
> module is written in C, it no longer uses the GIL? I seem to remember
> something along these lines but I haven't looked into all the details
> of when the GIL comes into play and when it doesn't.
The GIL is always used, but you can explicitly release and acquire it
from C code if you're not doing anything with PyObjects for a period of
time (i.e. waiting for I/O, doing computation, etc.).
More information about the Twisted-Python