473,800 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

retrieving the return code from a spawned thread.

JY
hi all,

I would like to know how I can retrieve in my main thread (see
[A]) the
return code from a thread (see [b]) that I launched :

[b]
class example(threadi ng.Thread):

def __init__(self, filename):
self.filename = filename
threading.Threa d.__init__(self )
self.start()

def run(self):
........
rc = os.system("comm and example")

[A] in the main thread:
......
thrdExample = []
thrdExample.app end(example(fil e))
......

once thrdExample[i] is not active anymore, how can I test its return
code "rc" if the main thread ??

thanks in advance,
JY
Jul 18 '05 #1
0 943

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

Similar topics

1
1228
by: Jean-Yves Nief | last post by:
hi all, I would like to know how I can retrieve in my main program the return code from a thread that I launched: class example(threading.Thread): def __init__(self, filename): self.filename = filename threading.Thread.__init__(self) self.start()
3
382
by: Tom Rahav | last post by:
Hello All, I developed a client-server file transfer application using C# for my studies. Everything works fine, but I use the follwing code (which I've found somewhere over the net) and I'm wondering why does this code contain the Sleep method. I know what this method does, but don't find the reason why to use it here (althoght it works :-) Just to make it clearer, the server is waiting for client request, accept it and handle the...
2
1245
by: mb | last post by:
got the following code snippet that i've modified off the internet to work - but damn if i know how and i dont like that. im having trouble with the following thread declaration that creates the thread, calls the ScanPorts method in the ScanPorts class and somehow passes in the array list scannedSystems. i'm stumped - how does it do all that on one line? thanks all. private ArrayList scannedSystems; scannedSystems.Add(new...
14
2042
by: TT (Tom Tempelaere) | last post by:
Hi people, The code that follows throws an ExecutionEngineException. This was written in C# (Microsoft Visual C# .NET 69462-335-0000007-18823) using MSDE 7.1 (7.1.3088). The framework is .NET 1.1 (1.1.4322). I tested the program on a Windows XP Professional/SP1, with a Pentium 4/2.6Ghz processor, with 2Gb RAM. The code is a single form that when run throws an ExecutionEngineException in 'AddRowsToTable'. If someone with more...
2
1013
by: alex444 | last post by:
Hi all, I'm getting the following exception when trying to open an Access DB from the new thread: The Microsoft Jet database engine cannot open the file '\\path\errorLog.mdb'. It is already opened exclusively by another user, or you need permission to view its data. The point is that the main thread can access that file no trouble at all (hence it's coded that only a spawned thread should do this).
38
2040
by: yomgui | last post by:
hello, is it legal to return inside a for loop or am I obliged to break out of the loop before returning ? thanks yomgui
1
1169
by: Alvin A. Delagon | last post by:
Is there any way to fetch the Return results of spawned threads within the parent script? I would like to do that because I'm having problems with Threads that do queries to a database, I often encounter Threads failing due to MySQL connection failures. As much as possible I plan to make the threads return the query string and let the parent script do the actual query. Thanks in advance.
11
2035
by: Nemisis | last post by:
Hi everyone, sorry if this post gets really long, i just wanna make sure i fully explain what i am trying to do. I am new to OOP and .net 2.0, so if this is obvious, i am sorry. I have wrote a data access layer, which contists of separate servicebases for each object within my database. CompanyDataService (contains CRUD methods) ContactDataService (contains CRUD methods)
1
1788
by: Vishal Sethia | last post by:
Just trying to understand the behaviour of spawn. Consider I have a function which creates two threads. And in one of the threads I make a call to pexpect.spawn. spawn would fork and create a new new child In this case who becomes the owner of this child process. Is it the thread that spawned becomes the owner or is the main program becomes the owner of that child process. Thanks, -V
0
9690
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10505
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10275
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.