call to pypcap in separate thread blocks other threads
invalid at invalid.invalid
Wed Dec 30 17:44:40 CET 2009
On 2009-12-30, Dmitry Teslenko <dteslenko at gmail.com> wrote:
> I'm making gui gtk application. I'm using pypcap
> (http://code.google.com/p/pypcap/) to sniff some network packets.
> To avoid gui freezing I put pcap call to another thread.
> Pypcap call looks like:
> pc = pcap.pcap()
> for ts, pkt in pc:
> spkt = str(pkt)
> Sadly, but this call in another thread blocks gtk gui thread anyway.
> If I substitute pcap call with something else separate thread don't block
> gui thread.
It sounds like the pcap wrapper code doesn't release the GIL
before making a blocking system call. If that's the case,
you'll have to do some hacking on the C-language extension
More information about the Python-list