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

Thread is not user-suspended; it can not be resumed

I'm receiving the above mentioned error.The problem is:
"I suspend one thread.Another thread is resuming the first thread.Then I
added following code:Its in simple english
if(first thread is not suspended)
then sleep(100)
else
resume first Thread
After adding this code every thing is fine.
Its in C#.
So my question is When we suspend thread, is it suspended at that time only
or it take some time to suspend?
Nov 15 '05 #1
1 4815

"Amratash" <am*******@knowsys.net> wrote in message
news:Oy**************@TK2MSFTNGP10.phx.gbl...
I'm receiving the above mentioned error.The problem is:
"I suspend one thread.Another thread is resuming the first thread.Then I
added following code:Its in simple english
if(first thread is not suspended)
then sleep(100)
else
resume first Thread
After adding this code every thing is fine.
Its in C#.
So my question is When we suspend thread, is it suspended at that time only or it take some time to suspend?
<snip from MSDN .NET >
Unlike Thread.Sleep, Thread.Suspend does not cause a thread to immediately
stop execution. The common language runtime must wait until the thread has
reached a safe point before it can suspend the thread.
....
When one thread calls Thread.Suspend on another thread, the call is a
_nonblocking_ call that causes the other thread to pause.
....
threadstate goes from
SuspendRequested
Suspended

</snip>

HTH

greetz

Nov 15 '05 #2

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

Similar topics

3
by: David Sworder | last post by:
This message was already cross-posted to C# and ADO.NET, but I forgot to post to this "general" group... sorry about that. It just occured to me after my first post that the "general" group readers...
2
by: C | last post by:
All, I am trying to run my BO in a separate thread, so that I can give the user a visual of the status of my process in a asp.net page/site. All works fine, IF the ASPNET user has admin rights,...
7
by: Ford Prefect alias Armin | last post by:
I want to start a Thread and wait till the Thread has been stopped (via Suspend) How to do this. Sub Test Start Thread Wait Till Stopped Go on with this code as sone as the Thread has...
6
by: Joe Jax | last post by:
I have an object that spawns a worker thread to process one of its methods. That method processes methods on a collection of other objects. During this processing, a user may request to cancel the...
0
by: Matt | last post by:
I'm attempting to load a form, query a database, and update a progress bar on the same form. I want the form to load and activate/enable the form's cancel button while the code continues to...
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...
10
by: Jon Slaughter | last post by:
Since a thread doesn't have a Stop feature and I'm not supose to use abort, I'm wondering how I stop a thread? My problem is that I simply want to excute a function in the background and...
5
by: Brian | last post by:
I have an file based asp.net application the creates a thread to do some background printing. It works fine but when the application is deployed on a web server, the following error occurs in the...
4
by: =?iso-8859-1?q?Eir=EDkur_Fannar_Torfason?= | last post by:
I'm wrestling with a problem that I'm hoping someone can help me with. I have a web application written in VS.2003 and running on version 1.1 of the .NET Framework on XP pro and Windows server...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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:
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
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...

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.