473,387 Members | 1,553 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.

Need help regarding threading

Hi all
I am having problem at a time of handling threading.
I am having application containing thread.
In thread procedure i ma using recursive function.
This recursive function is adding some entries in my temprary file.
But when i called abort on thread it is not aborting that thread.
After calling aborting still entries are getting inserted into
temporary files.
That means still recursive function is getting executed.
Can some one tell me why this is happening even after calling abort on
thread.
Is there any alternative for aborting thread.
Please help me as this is very very important for me.

Thanks in advance.

Jul 22 '05 #1
3 1349

The thing that you have to be carefull is that the threaad you are creating
is not creating sub threads inside your recusrisv function other wise you
will never give up.
Try to log the thread ID or name when you start it for the first time then
retrive the current thread name when recusrsive is called, just to be sure
that you are not creating threads of threads.

Post also your sample code
"tr**************@yahoo.com" wrote:
Hi all
I am having problem at a time of handling threading.
I am having application containing thread.
In thread procedure i ma using recursive function.
This recursive function is adding some entries in my temprary file.
But when i called abort on thread it is not aborting that thread.
After calling aborting still entries are getting inserted into
temporary files.
That means still recursive function is getting executed.
Can some one tell me why this is happening even after calling abort on
thread.
Is there any alternative for aborting thread.
Please help me as this is very very important for me.

Thanks in advance.

Jul 22 '05 #2
<tr**************@yahoo.com> wrote:
I am having problem at a time of handling threading.
I am having application containing thread.
In thread procedure i ma using recursive function.
This recursive function is adding some entries in my temprary file.
But when i called abort on thread it is not aborting that thread.
After calling aborting still entries are getting inserted into
temporary files.
That means still recursive function is getting executed.
Can some one tell me why this is happening even after calling abort on
thread.
Is there any alternative for aborting thread.
Please help me as this is very very important for me.


Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

You should pretty much never call Thread.Abort. See
http://www.pobox.com/~skeet/csharp/t...shutdown.shtml and
http://www.pobox.com/~skeet/csharp/threads/abort.shtml

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 22 '05 #3

Hi there,

Threads are a bit tricky to work with. Follow other suggestions here (sub
threads). If you cannot figure it out, you can always use a global variable
and have the loop (or whatever you are using for this matter) check this
variable for a particular value that will signal abort.

Good luck!

--
Juan Romero
-----------------------------------------
The successful person has the habit of doing the things failures don't like
to do.
E.M. Gray
"tr**************@yahoo.com" wrote:
Hi all
I am having problem at a time of handling threading.
I am having application containing thread.
In thread procedure i ma using recursive function.
This recursive function is adding some entries in my temprary file.
But when i called abort on thread it is not aborting that thread.
After calling aborting still entries are getting inserted into
temporary files.
That means still recursive function is getting executed.
Can some one tell me why this is happening even after calling abort on
thread.
Is there any alternative for aborting thread.
Please help me as this is very very important for me.

Thanks in advance.

Jul 22 '05 #4

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

Similar topics

6
by: akash shetty | last post by:
hi, im developing a code which requires searching a large database(bioological) for certain patterns.the size of the file is 3.5GB . the search pattern is a ten letter string.the database...
8
by: Bf | last post by:
I was creating test projects using c# and was surprised that there seems to be only a form based windows applications available. Is it safe to assume that classic window applications that utilize a...
4
by: trialproduct2004 | last post by:
Hi all i am having application in C#. here what i want it to update one datagrid depending on particular value. I want to start minimum of 5 threads at a time and all these threads are updating...
2
by: Chandrakant Shinde | last post by:
Hi there, I want to copy a Image to the clipboard. When i try to do so following exception occurs : "The current thread must set to Single Thread Apartment (STA) mode before OLE calls can be...
3
by: trialproduct2004 | last post by:
Hi all I am having problem at a time of handling threading. I am having application containing thread. In thread procedure i ma using recursive function. This recursive function is adding some...
2
by: NiponW | last post by:
Hi, I have SQL SERVER 2000 SP4 Enterprise , Windows 2003 Enterprise on Xeon 4 Processors (now with multi-threading CPU) and I have questions which seem weirds to me (used to have the same...
10
by: HK | last post by:
With VB.NET 2005, and a Windows Form, running on a dual CPU box, I need to take a recordset (e.g. 100,000 records) and spawn a thread to handle an internet XML transaction routine for each of the...
4
by: archana | last post by:
Hi all, I am having one confusion regarding invoking web method of web service asychronously through windows applicaiton. What i am doing is i am having one long runing web method whose one...
3
by: archana | last post by:
Hi all, I have one confusion regarding threading in windows service which is developed in c#. What i am doing is on 'onstart' event i am starting one thread. In thread procedure i am...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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
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.