473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

PyThreadState_SetAsyncExc (nThreadId ??????, exc);

iwl
what is the nThreadId-Parameter of PyThreadState_SetAsyncExc?

I try to implement a Terminate-Button in my C-Prog for my
embedded Python, but its hard to find an example how to
stop an interpreter running in an thread.

I found no other Python C-App-Func returning such a parameter.

Dec 14 '06 #1
1 2150
iwl wrote:
what is the nThreadId-Parameter of PyThreadState_SetAsyncExc?

I try to implement a Terminate-Button in my C-Prog for my
embedded Python, but its hard to find an example how to
stop an interpreter running in an thread.

I found no other Python C-App-Func returning such a parameter.
Use the "thread_id" member of the PyThreadState object:

PyThreadState *tstate;

PyThreadState_SetAsyncExc(tstate->thread_id,exc);

-Karl
Dec 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bob Alistar | last post by:
Hello! I have an IVR server controlling Dialogic hardware through a DLL exposing the C API to Python. The server farms out incoming calls to python scripts based on the telephone number that...
0
by: Antoon Pardon | last post by:
I have been playing a bit with PyThreadState_SetAsyncExc. Now the documentation abouth this call states the following: | Returns the number of thread states modified; if it returns a number |...
6
by: Hema S | last post by:
Hi, I want to use excel object in my asp.net application. When excel application is installed its working fine. When i uninstal the excel application and refer the relevant dll explicitly... i...
3
by: Fabri | last post by:
window.onbeforeunload = function() { if (x == false){ return "Is it ok?"; } This piece of code let users of my intranet to not exif accidentally from yhe page. I would also, after they have...
0
by: spam_john | last post by:
I am attempting to raise an exception in a thread currently calling PyEval_CallObject from another thread using PyThreadState_SetAsyncExc. The PyEval_CallObject is currently calling of a function...
6
by: Klaus Ahrens | last post by:
hi all, acoording to the c++ standard "15.3. - -10- Referring to any non-static member or base class of an object in the handler for a function-try-block of a constructor or destructor for...
0
by: gabriel.becedillas | last post by:
Does anyone know if PyThreadState_SetAsyncExc stops a thread while its inside a native extension ? I'm trying to stop a testing script that boils down to this: while True: print "aaa"...
0
by: gabriel.becedillas | last post by:
I use PyThreadState_SetAsyncExc to stop a python thread but there are situations when the thread doesn't stop and continues executing normally. After some debugging, I realized that the problem is...
3
by: johan2sson | last post by:
The documentation for PyThreadState_SetAsyncExc says "To prevent naive misuse, you must write your own C extension to call this". Anyone care to list a few examples of such naive misuse? Johan
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.