473,408 Members | 1,867 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,408 software developers and data experts.

Running a thread with timeout

Hi,

I'm fairly new to threading and i would like to start a new thread but when
the thread isn't completed within 30 seconds i would like the thread to end
and resume the procedure that started the thread. Preferably with an event.

I tried to find information on the internet but i can't find a sample that i
understand.
The samples that are provided include several other things that i think i
don't need.
Language is a problem and i can't find any (good) samples in my own language.

If you can, please help, it would be greatly appriciated

Thanks in advance!

Rob Smeets

Nov 21 '05 #1
3 995

My first thought is that if you are "resuming the procedure that started the
thread", you are wanting to block the program until the thread finishes or
times out. If this is the case, do you really need a thread at all?

"Rob Smeets" <Ro*******@discussions.microsoft.com> wrote in message
news:DF**********************************@microsof t.com...
Hi,

I'm fairly new to threading and i would like to start a new thread but
when
the thread isn't completed within 30 seconds i would like the thread to
end
and resume the procedure that started the thread. Preferably with an
event.

I tried to find information on the internet but i can't find a sample that
i
understand.
The samples that are provided include several other things that i think i
don't need.
Language is a problem and i can't find any (good) samples in my own
language.

If you can, please help, it would be greatly appriciated

Thanks in advance!

Rob Smeets


Nov 21 '05 #2
Did you try thread.suspend , thread.sleep etc etc it has lot of
options.

Regards,
C#, VB.NET , SQL SERVER , UML , DESIGN Patterns Interview question book
http://www.geocities.com/dotnetinterviews/

Nov 21 '05 #3
Rob,

Would you not try with a more simpler solution. A thread is not something
that stops direct when you abort it etc.

As well can you tell why you want to use threading (as Robin already asked).
Often we see here that people want to use threading and than the only result
is that the application takes more resources and time.

Language should not be a problem, the most activate persons in this
newsgroup are from German, English, Danish, Spanish and Dutch speaking
countries (I hope I forget nobody) and there are a lot of visitors with
other native languages. While your name sound at least Dutch.

Cor
Nov 21 '05 #4

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

Similar topics

9
by: Brian Roberts | last post by:
I have a command line Python program that sometimes takes a bit (several minutes) to run. I want to provide an optional method for an impatient user (me!) to check the status of the program. The...
17
by: Larry Woods | last post by:
I have a server page that has served an HTML page with a "Cancel" button on it, BUT this server page has not completed and is running a 15-30 second process before it completes. I want the browser...
10
by: Jacek Popławski | last post by:
Hello. I am going to write python script which will read python command from socket, run it and return some values back to socket. My problem is, that I need some timeout. I need to say for...
28
by: dcrespo | last post by:
Hi all, How can I get a raised exception from other thread that is in an imported module? For example: --------------- programA.py ---------------
0
by: puff | last post by:
When interfacing to a COM object, is it possible to pump messages in a thread? I'm working on an application that automates IE and needs to monitor IE events (yes I know about Pamie). I'm able...
9
by: esakal | last post by:
Hello, I'm programming an application based on CAB infrastructure in the client side (c# .net 2005) Since my application must be sequencally, i wrote all the code in the UI thread. my...
13
by: Jordan | last post by:
All, I have a UI form calling a class object that contains a timer that routinely draws intensive information to the screen (~30 fps). The drawing is invoked on the main UI thread. I need the...
1
by: Chrace | last post by:
Hi all, I have a problem with with Thread.Join( Timeout ) where the timeout never occurs. I basically need to make a connection to an AS400 box which works fine. Once in a blue moon the AS400...
3
by: yeye.yang | last post by:
hey everybody Does everybody can help me or give me some advise for the cross thread exception catch Here is what I want to do: I have 2 classes "Scenario" and "Step", which have a...
5
by: zxo102 | last post by:
Hello All, I have a system. An instrument attched to 'com1' is wireless connected to many sensors at different locations. The instrument can forward the "commands" (from pyserial's write()) to...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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...
0
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...

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.