> 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
>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://
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'
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
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
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
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
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
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
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
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.
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
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
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
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
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):
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
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_
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
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
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
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
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
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/
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
86 matches
Mail list logo