Re: c bindings with non-python thread callback while python exits

2021-01-26 Thread Barry Scott
> On 26 Jan 2021, at 14:35, Paul Grinberg wrote: > > I have a C++ library (luckily with source code, so I know what's going on) to > which I wrote c bindings. The library internally starts an event pthread > which generates callbacks back into python. The c binding for processing > these ca

c bindings with non-python thread callback while python exits

2021-01-26 Thread Paul Grinberg
I have a C++ library (luckily with source code, so I know what's going on) to which I wrote c bindings. The library internally starts an event pthread which generates callbacks back into python. The c binding for processing these callbacks look like this (simplified for convenience): PyGILState

Re: Process in not get killed using subprocess.call() in python thread

2017-07-13 Thread Rhodri James
On 13/07/17 16:42, sanky8...@gmail.com wrote: I have created one thread in python, and that thread is running in infinite loop, but when I was trying to kill a process by making use of subprocess.call("my ps command") Its not actually working Here is the code, import threading import subp

Process in not get killed using subprocess.call() in python thread

2017-07-13 Thread sanky8793
I have created one thread in python, and that thread is running in infinite loop, but when I was trying to kill a process by making use of subprocess.call("my ps command") Its not actually working Here is the code, import threading import subprocess def B(): while True: cmd="ps

Re: Manipulate GIL to have Python thread work with pthread native ones

2016-06-01 Thread Lawrence D’Oliveiro
On Tuesday, May 31, 2016 at 10:14:31 PM UTC+12, qsh...@alumni.sjtu.edu.cn wrote: > PyGILState_Ensure/PyGILState_Release. Without a running sample, it is a > little bit hard to understand how Python thread and the native pthread > interact. Python threads *are* native threads (at least

Re: Manipulate GIL to have Python thread work with pthread native ones

2016-06-01 Thread dieter
qshh...@alumni.sjtu.edu.cn writes: ... Python/C++ integration ... When I learn about a task to integrate Python with C or C++, I first think of "cython". "cython" facilitates those integrations. Especially, it has annotations to control the GIL. I have used "cython" for the implementation of a Py

Re: Manipulate GIL to have Python thread work with pthread native ones

2016-05-31 Thread Terry Reedy
On 5/31/2016 1:16 AM, qshh...@alumni.sjtu.edu.cn wrote: Hi Python experts, I need to extend Python with C/C++ to interact with an in-house legacy API. I'm implementing a data subscriber with Python, which subscribes to a data publisher (actually a ZeroMQ publisher socket) and will get notified o

Manipulate GIL to have Python thread work with pthread native ones

2016-05-31 Thread qshhnkf
tate-and-the-global-interpreter-lock I read the document but still not sure where to add the PyGILState_Ensure/PyGILState_Release. Without a running sample, it is a little bit hard to understand how Python thread and the native pthread interact. Would you mind review the source code and dire

Re: This Python 3 is killing Python thread is killing me.

2014-07-16 Thread Chris Angelico
On Thu, Jul 17, 2014 at 4:16 AM, alister wrote: > I have had a number of > enjoyable holidays in the USA and 90% of the people I have met there have > been great. I'd go even further. I've only actually visited the US once, but everyone was great except for *one* unpleasant experience with staff

Re: This Python 3 is killing Python thread is killing me.

2014-07-16 Thread Chris Angelico
On Thu, Jul 17, 2014 at 6:40 AM, Skip Montanaro wrote: > On Wed, Jul 16, 2014 at 3:27 PM, Mark Lawrence > wrote: >> The difference between our most illustrious resident unicode expert and rr > > Sorry, who is "rr"? I went looking in the referenced thread but found > nobody with those initials. N

Re: This Python 3 is killing Python thread is killing me.

2014-07-16 Thread Jason Swails
On Wed, Jul 16, 2014 at 1:27 PM, Mark Lawrence wrote: > > The difference between our most illustrious resident unicode expert and rr > is that the former has only said anything of use once, whereas the latter > does know about tkinter/IDLE. rr doesn't show up that often, the MIRUC has > been spe

Re: This Python 3 is killing Python thread is killing me.

2014-07-16 Thread Ethan Furman
On 07/16/2014 02:32 PM, MRAB wrote: On 2014-07-16 21:40, Skip Montanaro wrote: Sorry, who is "rr"? I went looking in the referenced thread but found nobody with those initials. Not so helpfully, Gmail elides most sigs, so I couldn't reliably scan the full text either. "rr" is "rantingrickjohn

Re: This Python 3 is killing Python thread is killing me.

2014-07-16 Thread MRAB
On 2014-07-16 21:40, Skip Montanaro wrote: On Wed, Jul 16, 2014 at 3:27 PM, Mark Lawrence wrote: The difference between our most illustrious resident unicode expert and rr Sorry, who is "rr"? I went looking in the referenced thread but found nobody with those initials. Not so helpfully, Gmail

Re: This Python 3 is killing Python thread is killing me.

2014-07-16 Thread Skip Montanaro
On Wed, Jul 16, 2014 at 3:27 PM, Mark Lawrence wrote: > The difference between our most illustrious resident unicode expert and rr Sorry, who is "rr"? I went looking in the referenced thread but found nobody with those initials. Not so helpfully, Gmail elides most sigs, so I couldn't reliably sca

Re: This Python 3 is killing Python thread is killing me.

2014-07-16 Thread Mark Lawrence
On 16/07/2014 20:24, Jason Swails wrote: On Wed, Jul 16, 2014 at 11:40 AM, Mark Lawrence mailto:breamore...@yahoo.co.uk>> wrote: On 16/07/2014 18:32, Deb Wyatt wrote: Can you all stop already with the non python US bashing? Please? Deb in WA, USA rr started it with

Re: This Python 3 is killing Python thread is killing me.

2014-07-16 Thread Jason Swails
On Wed, Jul 16, 2014 at 11:40 AM, Mark Lawrence wrote: > On 16/07/2014 18:32, Deb Wyatt wrote: > >> Can you all stop already with the non python US bashing? Please? >> >> Deb in WA, USA >> >> > rr started it with a fairly impressive piece of trolling but as you've > asked so politely I will happ

Re: This Python 3 is killing Python thread is killing me.

2014-07-16 Thread Mark Lawrence
On 16/07/2014 18:32, Deb Wyatt wrote: Can you all stop already with the non python US bashing? Please? Deb in WA, USA rr started it with a fairly impressive piece of trolling but as you've asked so politely I will happily oblige. -- My fellow Pythonistas, ask not what our language can do

Re: This Python 3 is killing Python thread is killing me.

2014-07-16 Thread Ian Kelly
On Wed, Jul 16, 2014 at 11:32 AM, Deb Wyatt wrote: > Can you all stop already with the non python US bashing? Please? I read it more as counter-US-glorification-trolling than bashing, but in any case that subthread seems to have died down already, so you should be safe to start reading again if

Re: This Python 3 is killing Python thread is killing me.

2014-07-16 Thread alister
On Wed, 16 Jul 2014 09:32:31 -0800, Deb Wyatt wrote: > Can you all stop already with the non python US bashing? Please? > > Deb in WA, USA > > Protect > your computer files with professional cloud backup. > Get PCRx Backup and upload

Re: This Python 3 is killing Python thread is killing me.

2014-07-16 Thread Abhiram R
On Wed, Jul 16, 2014 at 11:02 PM, Deb Wyatt wrote: > Can you all stop already with the non python US bashing? Please? > > Deb in WA, USA > > > > -- > https://mail.python.org/mailman/listinfo/python-list > ​I'm actually picking up a lot of snippets of information from that thread by being a spe

This Python 3 is killing Python thread is killing me.

2014-07-16 Thread Deb Wyatt
Can you all stop already with the non python US bashing? Please? Deb in WA, USA Protect your computer files with professional cloud backup. Get PCRx Backup and upload unlimited files automatically. Learn more at http://backup.pcrx.com

Re: Python thread

2011-09-01 Thread Adam Skutt
On Sep 1, 5:14 pm, George wrote: > Hi, > Why doesn't python threads show an associated PID?  On spawning python > threads using the threading module I can only see the main thread's pid on > using top or ps unix command, no  subprocesses are displayed. In otherwords > top or ps in not aware of any

Re: Python thread

2011-09-01 Thread Adam Skutt
On Sep 1, 5:54 pm, Terry Reedy wrote: > > Does it mean that python threads are not mapped to the core in the system. > > They all run on the same core. > No, CPython is a native thread implementation, so they'll be scheduled however the kernel sees fit. Only allowing one thread to run at a time

Re: Python thread

2011-09-01 Thread Christian Heimes
Am 02.09.2011 00:46, schrieb Benjamin Kaplan: > Threading is an OS-level construct to allow concurrency within a > single process (and address space). Threads are never supposed to be > separate processes (they aren't at the C-level, so I don't know what > Java is doing here). CPython code has a gl

Re: Python thread

2011-09-01 Thread Terry Reedy
On 9/1/2011 6:08 PM, George wrote: So what exactly does threading module do, if it doesn't create a subprocess. Does each thread have its own stack and PC. What advantage would a threading module provide over sequential execution. https://secure.wikimedia.org/wikipedia/en/wiki/Thread_%28compute

Re: Python thread

2011-09-01 Thread Benjamin Kaplan
On Thu, Sep 1, 2011 at 6:21 PM, Prasad, Ramit wrote: >>So what exactly does threading module do, if it doesn't create a subprocess. >>Does each thread have its own stack and PC. >>What advantage would a threading module provide over sequential execution. > > I believe it merely simulates multiple

RE: Python thread

2011-09-01 Thread Prasad, Ramit
>So what exactly does threading module do, if it doesn't create a subprocess. >Does each thread have its own stack and PC. >What advantage would a threading module provide over sequential execution. I believe it merely simulates multiple processes through scheduling (like the CPU). >From http://

Re: Python thread

2011-09-01 Thread George
So what exactly does threading module do, if it doesn't create a subprocess. Does each thread have its own stack and PC. What advantage would a threading module provide over sequential execution. On 01/09/2011 22:54, "Terry Reedy" wrote: > On 9/1/2011 5:14 PM, George wrote: >> Hi, >> Why doesn'

Re: Python thread

2011-09-01 Thread Terry Reedy
On 9/1/2011 5:14 PM, George wrote: Hi, Why doesn't python threads show an associated PID? On spawning python threads using the threading module I can only see the main thread's pid on using top or ps unix command, no subprocesses are displayed. In otherwords top or ps in not aware of any subpro

Re: NewBie Doubt in Python Thread Programming

2011-05-12 Thread Chris Angelico
On Thu, May 12, 2011 at 7:42 PM, vijay swaminathan wrote: > Hi Chris, > > I tried using os.system as well but it did not even open up the command > prompt. > > Can you please share the code that worked for you.. just wondering if I'm > missing something very basic. Caveat: I'm not using Qt, I jus

Re: NewBie Doubt in Python Thread Programming

2011-05-12 Thread vijay swaminathan
Hi Chris, I tried using os.system as well but it did not even open up the command prompt. Can you please share the code that worked for you.. just wondering if I'm missing something very basic. Regards, -Vijay Swaminathan., On Thu, May 12, 2011 at 1:38 PM, Chris Angelico wrote: > On Thu, May

Re: NewBie Doubt in Python Thread Programming

2011-05-12 Thread Chris Angelico
On Thu, May 12, 2011 at 3:35 PM, vijay swaminathan wrote: > I tried using QThread as well.. But the problem is, on the run method when i > invoke the command prompt, it sends out the finished signal...  I want it to > send out the finished signal only on closing the command prompt that is > invoke

Re: NewBie Doubt in Python Thread Programming

2011-05-11 Thread vijay swaminathan
I tried using QThread as well.. But the problem is, on the run method when i invoke the command prompt, it sends out the finished signal... I want it to send out the finished signal only on closing the command prompt that is invoked earlier in my process. guess some logic to be implement inside r

Re: NewBie Doubt in Python Thread Programming

2011-05-11 Thread Wojtek Mamrak
2011/5/11 Chris Angelico : > On Thu, May 12, 2011 at 1:16 AM, Wojtek Mamrak wrote: >> Is there any special reason you don't want to use QThread? >> http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qthread.html#details > > Other than that QThread is part of QT and threading isn't, what ar

Re: NewBie Doubt in Python Thread Programming

2011-05-11 Thread Chris Angelico
On Thu, May 12, 2011 at 1:16 AM, Wojtek Mamrak wrote: > Is there any special reason you don't want to use QThread? > http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qthread.html#details Other than that QThread is part of QT and threading isn't, what are the advantages of QThread? Is it

Re: NewBie Doubt in Python Thread Programming

2011-05-11 Thread Wojtek Mamrak
Is there any special reason you don't want to use QThread? http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qthread.html#details regards 2011/5/11 Chris Angelico : > On Wed, May 11, 2011 at 7:08 PM, vijay swaminathan wrote: >> Sorry. My intention was not to send out a private message.

Re: NewBie Doubt in Python Thread Programming

2011-05-11 Thread Chris Angelico
On Wed, May 11, 2011 at 7:08 PM, vijay swaminathan wrote: > Sorry. My intention was not to send out a private message. when I chose > reply to all, I was confused if this would start as a new thread. so just > did a reply.. No probs. If you just send your response to the list python-list@python.o

Re: NewBie Doubt in Python Thread Programming

2011-05-11 Thread vijay swaminathan
Sorry. My intention was not to send out a private message. when I chose reply to all, I was confused if this would start as a new thread. so just did a reply.. coming back, I have developed a GUI based on pyQT4 which has a run button. when I click on run, it invokes a command prompt and runs a .b

Re: NewBie Doubt in Python Thread Programming

2011-05-11 Thread Chris Angelico
I'm responding to this on-list on the assumption that this wasn't meant to be private; apologies if you didn't intend for this to be the case! On Wed, May 11, 2011 at 6:38 PM, vijay swaminathan wrote: > so If i understand correctly, once the run method of the thread is executed, > the thread is n

Re: NewBie Doubt in Python Thread Programming

2011-05-11 Thread James Mills
On Wed, May 11, 2011 at 4:57 PM, vijay swaminathan wrote: [...] > 1. How the total active thread is 2? Your threads are terminating as normal. Without some kind of loop in your run() method they will execute the instructions and terminate. > 2. how do I stop a thread? does it get automatically

Re: NewBie Doubt in Python Thread Programming

2011-05-11 Thread Gabriel Genellina
En Wed, 11 May 2011 03:57:13 -0300, vijay swaminathan escribió: Hi All, I'm new bie to thread programming and I need some assistance in understanding few concepts ... I have a very simple program which runs a thread and prints a string. import threading class MyThread(threading.Thread):

Re: NewBie Doubt in Python Thread Programming

2011-05-11 Thread Chris Angelico
On Wed, May 11, 2011 at 4:57 PM, vijay swaminathan wrote: >     for i in range(10): >     MyThread_Object.start() >     count = threading.activeCount() > > When I run this, I could see 10 thread being called. But when I print the > active thread count it is only 2. > > Need some understanding

NewBie Doubt in Python Thread Programming

2011-05-11 Thread vijay swaminathan
Hi All, I'm new bie to thread programming and I need some assistance in understanding few concepts ... I have a very simple program which runs a thread and prints a string. import threading class MyThread(threading.Thread): def __init__(self, parent = None): threading.Thread.__init_

Re: Cancelling a python thread (revisited...)

2009-11-09 Thread Antoine Pitrou
Le Sun, 08 Nov 2009 21:04:06 -0800, John Nagle a écrit : > Antoine Pitrou wrote: >> John Nagle animats.com> writes: >>> I'd argue against general thread cancellation. Inter-thread >>> signals, though, have safety problems no worse than the first-thread >>> only signals we have now. You're al

Re: Cancelling a python thread (revisited...)

2009-11-09 Thread John Nagle
Antoine Pitrou wrote: John Nagle animats.com> writes: I'd argue against general thread cancellation. Inter-thread signals, though, have safety problems no worse than the first-thread only signals we have now. You're allowed to raise an exception in a signal handler, which is effectively t

Re: Cancelling a python thread (revisited...)

2009-11-08 Thread sven
On Nov 8, 2:50 pm, exar...@twistedmatrix.com wrote: > I'm curious how this visualization works, since earlier you said > something to the affect that there were no shared resources.  If you > kill a thread and it had opened a window and was drawing on it, with > most toolkits, you'll end up with a

Re: Cancelling a python thread (revisited...)

2009-11-08 Thread Antoine Pitrou
John Nagle animats.com> writes: > > I'd argue against general thread cancellation. Inter-thread > signals, though, have safety problems no worse than the first-thread > only signals we have now. You're allowed to raise an exception > in a signal handler, which is effectively thread cancella

Re: Cancelling a python thread (revisited...)

2009-11-08 Thread John Nagle
Antoine Pitrou wrote: Le Sun, 08 Nov 2009 04:40:26 -0800, sven a écrit : I really don't get that. If the reason would be that it is too much work to implement, then I could accept it. It would probably be a lot of work and even then it would still be unsafe. Read for example: http://msdn.mic

Re: Cancelling a python thread (revisited...)

2009-11-08 Thread Antoine Pitrou
Le Sun, 08 Nov 2009 04:40:26 -0800, sven a écrit : > > I really don't get that. If the reason would be that it is too much > work to > implement, then I could accept it. It would probably be a lot of work and even then it would still be unsafe. Read for example: http://msdn.microsoft.com/en-us/

Re: Cancelling a python thread (revisited...)

2009-11-08 Thread exarkun
On 12:40 pm, s...@uni-hd.de wrote: On Nov 8, 4:27�am, Carl Banks wrote: It doesn't sound like the thread is communicating with the process much. �Therefore: There is quite a bit of communication -- the computation results are visulized while they are generated. I'm curious how this visualiz

Re: Cancelling a python thread (revisited...)

2009-11-08 Thread sven
gt; 2. Create the thread from a C extension, maybe even straight from > ctypes, and kill it from C or ctypes. The second option is a good idea. Thanks a lot, Carl! > > And why on earth doesn't that cancel method exist? There *are* good > > reasons to cancel a thread, just goog

Re: Cancelling a python thread (revisited...)

2009-11-07 Thread John Nagle
Carl Banks wrote: Arguing that there are good reasons to allow killing threads isn't going to get you very far. The language developers already know killing a thread is useful, yet the disallowed it anyway. The drawbacks were judged too severe (it makes enforcing invariants pretty much impossib

Re: Cancelling a python thread (revisited...)

2009-11-07 Thread Carl Banks
On Nov 7, 6:04 pm, Sven Marnach wrote: > So do I really have to refactor my C library just because Python > Thread objects lack a cancel method?  Is there really no other way? It doesn't sound like the thread is communicating with the process much. Therefore: 1. Run the C code in

Cancelling a python thread (revisited...)

2009-11-07 Thread Sven Marnach
really have to refactor my C library just because Python Thread objects lack a cancel method? Is there really no other way? And why on earth doesn't that cancel method exist? There *are* good reasons to cancel a thread, just google for "terminate a Python thread" for tons of exampl

Re: PythonWin, python thread and PostQuitMessage?

2009-03-14 Thread aloonstra
On 13 mrt, 23:30, "Gabriel Genellina" wrote: > En Fri, 13 Mar 2009 17:59:34 -0200, escribió: > > > > > On 12 mrt, 18:43, "Gabriel Genellina" wrote: > >> En Thu, 12 Mar 2009 07:21:35 -0200, escribió: > > >> > I'm not so much involved in any Windows programming however I needed > >> > to write a

Re: PythonWin, python thread and PostQuitMessage?

2009-03-13 Thread Gabriel Genellina
En Fri, 13 Mar 2009 17:59:34 -0200, escribió: On 12 mrt, 18:43, "Gabriel Genellina" wrote: En Thu, 12 Mar 2009 07:21:35 -0200, escribió: > I'm not so much involved in any Windows programming however I needed > to write a client for the Windows platform. I have this very simple > question whi

Re: PythonWin, python thread and PostQuitMessage?

2009-03-13 Thread aloonstra
On 12 mrt, 18:43, "Gabriel Genellina" wrote: > En Thu, 12 Mar 2009 07:21:35 -0200, escribió: > > > I'm not so much involved in any Windows programming however I needed > > to write a client for the Windows platform. I have this very simple > > question which I've been unable to answer. I'm listen

Re: PythonWin, python thread and PostQuitMessage?

2009-03-12 Thread Gabriel Genellina
En Thu, 12 Mar 2009 07:21:35 -0200, escribió: I'm not so much involved in any Windows programming however I needed to write a client for the Windows platform. I have this very simple question which I've been unable to answer. I'm listening for keyboard strokes using the pyhook library. I'm doin

PythonWin, python thread and PostQuitMessage?

2009-03-12 Thread arnaud
Hi All, I'm not so much involved in any Windows programming however I needed to write a client for the Windows platform. I have this very simple question which I've been unable to answer. I'm listening for keyboard strokes using the pyhook library. I'm doing this in a dedicated thread. The gui jus

Re: concurrency program design stackless python tasklet or python thread?

2008-11-12 Thread davy zhang
thank you very much for the advices! I asked myself many times, why not just use thread:D After some research I found thread has some fatal defects 1. thread number is limited by os, that means the system don't want you start many threads at the same time 2. thread pool is another approach for c

Re: concurrency program design stackless python tasklet or python thread?

2008-11-11 Thread Aahz
In article <[EMAIL PROTECTED]>, davy zhang <[EMAIL PROTECTED]> wrote: > >first here is my basic idea is every actor holds their own msg queue, >the process function will handle the message as soon as the dispatcher >object put the message in. Sounds like a standard design. >This idea naturally le

Re: concurrency program design stackless python tasklet or python thread?

2008-11-11 Thread Aleksandar Radulovic
Hi there, On Tue, Nov 11, 2008 at 5:57 AM, davy zhang <[EMAIL PROTECTED]> wrote: > first here is my basic idea is every actor holds their own msg queue, > the process function will handle the message as soon as the dispatcher > object put the message in. Using stackless, every tasklet can have a

Re: concurrency program design stackless python tasklet or python thread?

2008-11-10 Thread davy zhang
thanks very much for the hint, circuits is a very good event-driven frame work just like twisted but currently my project is in a pretty much complex way see, I'm designing a so called "Game Server", every client has their own task execution order, see like below: 1.clientA wants to sale his ar

Re: concurrency program design stackless python tasklet or python thread?

2008-11-10 Thread James Mills
On Tue, Nov 11, 2008 at 3:57 PM, davy zhang <[EMAIL PROTECTED]> wrote: > first here is my basic idea is every actor holds their own msg queue, > the process function will handle the message as soon as the dispatcher > object put the message in. > > This idea naturally leads me to place every actor

concurrency program design stackless python tasklet or python thread?

2008-11-10 Thread davy zhang
first here is my basic idea is every actor holds their own msg queue, the process function will handle the message as soon as the dispatcher object put the message in. This idea naturally leads me to place every actor in a separate thread waiting for msg but the rumor has it, stackless python wit

Re: Interrupt python thread

2008-08-30 Thread Dieter Maurer
En Mon, 25 Aug 2008 05:00:07 -0300, BlueBird <[EMAIL PROTECTED]> escribi╴: > Unfortunately, this does not map very well with my program. Each of my > threads are calling foreign code (still written in python though), > which might be busy for 1 to 10 minutes with its own job. > > I wanted something

Re: Interrupt python thread

2008-08-25 Thread Gabriel Genellina
En Mon, 25 Aug 2008 05:00:07 -0300, BlueBird <[EMAIL PROTECTED]> escribi�: On Aug 24, 8:35 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:         The only safe way to "abort" a thread is by having it exit on its own. This means one needs a means of setting an attribute that each thread pe

Re: Interrupt python thread

2008-08-25 Thread BlueBird
On Aug 24, 8:35 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sun, 24 Aug 2008 01:48:46 -0700 (PDT), BlueBird > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > Whenever an exception occurs, in the master thread or in one of the > > slave threads, I would like to i

Re: Interrupt python thread

2008-08-25 Thread janislaw
On 24 Sie, 10:48, BlueBird <[EMAIL PROTECTED]> wrote: > > Whenever an exception occurs, in the master thread or in one of the > slave threads, I would like to interrupt all the threads and the main > program. Threading API does not seem to provide a way to stop a > thread, is there anyway to achiev

Re: Interrupt python thread

2008-08-24 Thread Fredrik Lundh
James Matthews wrote: def __stop(self): self.__block.acquire() self.__stopped = True self.__block.notifyAll() self.__block.release() have you tried using that method? what happened? looking at the code, what do you think it does? -- http://mail.python

Re: Interrupt python thread

2008-08-24 Thread James Matthews
def __stop(self): self.__block.acquire() self.__stopped = True self.__block.notifyAll() self.__block.release() On Sun, Aug 24, 2008 at 11:59 AM, Fredrik Lundh <[EMAIL PROTECTED]>wrote: > James Matthews wrote: > > Group all the threads in a list and call the st

Re: Interrupt python thread

2008-08-24 Thread Fredrik Lundh
James Matthews wrote: Group all the threads in a list and call the stop method on all of them. what stop method? -- http://mail.python.org/mailman/listinfo/python-list

Re: Interrupt python thread

2008-08-24 Thread James Matthews
Group all the threads in a list and call the stop method on all of them. On Sun, Aug 24, 2008 at 1:48 AM, BlueBird <[EMAIL PROTECTED]> wrote: > Hi, > > I have a program with a master thread and several slave threads. > > Whenever an exception occurs, in the master thread or in one of the > slave

Interrupt python thread

2008-08-24 Thread BlueBird
Hi, I have a program with a master thread and several slave threads. Whenever an exception occurs, in the master thread or in one of the slave threads, I would like to interrupt all the threads and the main program. Threading API does not seem to provide a way to stop a thread, is there anyway to

RE: python thread state

2006-10-24 Thread Stefan Schukat
Monday, October 23, 2006 2:32 PM > To: python-list@python.org > Subject: python thread state > > hi, > > i'm trying to write a multithreaded embedded python > application and i'm having some trouble. i found this > article "embedding python in multi

Re: Python thread stack size

2006-10-23 Thread Chetan
The default thread allocated in for pthread is 32K if the system default is lower (it is 16K on my system). If the system default is higher, it is used. -Chetan -- http://mail.python.org/mailman/listinfo/python-list

python thread state

2006-10-23 Thread Bryan
te_New wipes out, or rather gives you a new global dictionary, because i lost all my global variables. the article assumes you have one c thread per python thread state, but i want multiple c threads per python thread state. Is there a c api function that will associate a c thread without resettin

Interrupting a running python thread

2006-08-25 Thread johan2sson
I have embedded a python console in a plugin to a Windows application. I do not control the application, but the plugin is mine. Since the application is not thread-safe, I am push()-ing each line onto a code.InteractiveConsole on the GUI thread. This has the downside that a silly mistake that crea

[help]problem with python thread

2005-10-29 Thread BaoYongjun
Hi,all: Could someone explan the python thread to me? When I use the python thread,I find some problems.If I run many (such as 100) python threads ,then all thread are blocked.Below is the code: import thread,time def f(): print &#

Re: java crashes in python thread

2005-03-02 Thread Dieter Maurer
Easeway wrote: > I use os.system invoking java VM, when running in python thread, the > java application crashes. Andreas Jung has reported similar behaviour. He suggested that Java 1.4 and the threads of Linux 2.6 do not work reliably together. He tried Java 1.5 and this combination c

Re: java crashes in python thread

2005-03-01 Thread Peter Hansen
Easeway wrote: I use os.system invoking java VM, when running in python thread, the java application crashes. Can you define "crash" more precisely? Isn't there any kind of error message/traceback that would reveal more information about the problem? Also, how quickly do you

java crashes in python thread

2005-02-28 Thread Easeway
I use os.system invoking java VM, when running in python thread, the java application crashes. But it works properly when thread is not used. Has any body come across with this problem? Python 2.3.3 J2SDK 1.4.2_05 SuSE Linux Enterprise Server 9 The following is source file: #!/usr/bin/env

Re: Killing a python thread with a signal

2004-12-23 Thread Philippe C. Martin
On Thu, 2004-12-23 at 04:51, James Lamanna wrote: > So I've created a thread with the threading.Thread class, but I want to > be able to kill this thread because it does a select() with a timeout of > None. I do not know what type of information your thread reads from the sockets, but I added a

Re: Killing a python thread with a signal

2004-12-22 Thread Craig Ringer
On Thu, 2004-12-23 at 04:51, James Lamanna wrote: > So I've created a thread with the threading.Thread class, but I want to > be able to kill this thread because it does a select() with a timeout of > None. I recall seeing various discussion of signals and threading on the list in the past - it

Killing a python thread with a signal

2004-12-22 Thread James Lamanna
So I've created a thread with the threading.Thread class, but I want to be able to kill this thread because it does a select() with a timeout of None. Is there any way to send a signal only to this thread and wake it up from the select? Thanks. Please CC me for I am not subscribed. -- James La

[ANNOUNCE] Python Thread Validator software tool

2004-12-19 Thread Stephen Kellett
Python Thread Validator. A thread analysis, lock analysis and deadlock detection tool for Python. Tool is now in beta. http://www.softwareverify.com/pythonThreadValidator/index.html Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http