python threads?

Martin Owens doctormo-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Sun May 27 14:43:17 EDT 2007


Eww, although that explains a lot; I tried to do threading for my http
requests so my app wasn't waiting around for http round trips before
loading.

Now I get segment faults intermittently and a whole bunch of other weird things.

On 27/05/07, Cole Tuininga <colet-KCgK2vT7wad/90uGnh1m2w at public.gmane.org> wrote:
>
> Unfortunately, you're running into one of the little secrets of
> python ... the GIL (Global Interpreter Lock).  While python has support
> for "multithreading", it doesn't work the way you would normally think
> of threading.  If it still works the way it used to, the python
> interpreter basically runs 10 pseudo instructions (barring running into
> some kind of blocking call) and then swaps off to another thread.
>
> If you truly want to use multiple processors for a python program,
> multi-process with (your choice of) IPC is going to be the way to go.
>
> --
> A: Yes.
> > Q: Are you sure?
> >> A: Because it reverses the logical flow of conversation.
> >>> Q: Why is top posting annoying in email?
>
> Cole Tuininga
> colet-KCgK2vT7wad/90uGnh1m2w at public.gmane.org
> http://www.code-energy.com/
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
> _______________________________________________
> Discuss mailing list
> Discuss-mNDKBlG2WHs at public.gmane.org
> http://lists.blu.org/mailman/listinfo/discuss
>

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.






More information about the Discuss mailing list