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

Process works in step mode(debugging) only??

I have a thread:

ThreadStart myThreadDelegate = new
ThreadStart(ThreadFunction1.getOneAtATime);
Thread thr1 = new Thread(myThreadDelegate);
thr1.Start();

then another function that only works if in debug mode...I thought it
just needed slowing down, but that didn't work either.
It happens in a do loop:

do{ <--works only in debug mode.
//do something
Thread.Sleep(1000);
} while (couNTer1 == false);

Any help is appreciated.
Thanks,
Trint

Nov 17 '05 #1
7 2161
Need more information. What exactly isn't working?

Commonly, when a threaded process works only in debug mode, it's
because a dependent process gets ahead of it. It's a synchronization
problem.

But I'm not sure anyone will be able to help you without having more
information about the problem.

Nov 17 '05 #2
I want it to stay in this do loop, but if it isn't in debug "stepping",
it breaks on it's own:

bool couNTer1 = false;
do
{
Form1 findThread = new Form1();
findThread.label15.Text = ("0" + " Invoices Left to Print");
findThread.loadInvoiceContainer();
findThread.label15.Text = (Convert.ToString(Class1.cI) + "
Invoices Left to Print");
findThread.button7.Text = "&Watching for New Invoices";
if(Class1.cI > 0)
{
findThread.gotoForeach();
}
} while (couNTer1 == false);
Thanks,
Trint

Nov 17 '05 #3
"trint" <tr***********@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
I want it to stay in this do loop, but if it isn't in debug "stepping",
it breaks on it's own:

bool couNTer1 = false;
do
{
Form1 findThread = new Form1();
findThread.label15.Text = ("0" + " Invoices Left to Print");
findThread.loadInvoiceContainer();
findThread.label15.Text = (Convert.ToString(Class1.cI) + "
Invoices Left to Print");
findThread.button7.Text = "&Watching for New Invoices";
if(Class1.cI > 0)
{
findThread.gotoForeach();
}
} while (couNTer1 == false);
Thanks,
Trint

Well, for that loop to break out, couNTer1 has to be true. I don't even see
where that happens here... you must have something else going on that you
haven't shown us.

--
Adam Clauss
ca*****@tamu.edu
Nov 17 '05 #4
There is no break in any function within the do loop.
Does a thread have to be told to continue working?
Trint

Nov 17 '05 #5
Hi,

What is what you want to do?
A thread will live as long as the method being executed is running, when it
ends the thread cease of exist.

It seems that you want to do some processing in the background as wait for
invoices & print them.

How the invoices are received? Have you tried the FileWatcher class?

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"trint" <tr***********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
There is no break in any function within the do loop.
Does a thread have to be told to continue working?
Trint

Nov 17 '05 #6
I figured it out...I was trying to access a UI control in one of the
functions.
Thanks,
Trint

.Net programmer
tr***********@gmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #7

"trint" <tr***********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
There is no break in any function within the do loop.
Does a thread have to be told to continue working?
Trint

So you endlessly (or until it crashes!) create instances of Form1, call
loadInvoiceContainer() and possibly (if Class1.cI != 0) you call
gotoForeach().
I suppose "Class1.cI" is set to non-zero in your background thread, but
before this one gets a chance to run you might have run the loop a thousands
times, simply wasting CPU and memory resources, until it crashes, right?.

Willy.

Nov 17 '05 #8

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

Similar topics

6
by: Thomas Mlynarczyk | last post by:
Hello! I run PHP 4.3 as an Apache module. I use Apache 1.3 as a service under WinXP. And I've got a strange problem with exec(): The following commands are executed correctly:...
1
by: Angelos | last post by:
Why does this Script does not work in Firefox ? I am trying to make a select deselect CHECKbox function with invert selection capability... But this script works only in IE :( Any Help and...
1
by: Jeffrey Frabutt | last post by:
Hey... I'm reletively new to ASP.NET and am having some frustrating debugging issues. Everything is configured correctly for me to debug my VERY simple one-page application. That said, after just...
25
by: Michal Kwiatkowski | last post by:
Hi, Code below shows that property() works only if you use it within a class. ------------------------------------------------ class A(object): pass a = A() a.y = 7
4
by: artur.siara | last post by:
Hello, I want to remove from string a <span> tag, but with leave the value of that tag. I have that code: theExp = new RegExp("<span>", "g"); txt = txt.replace(theExp, "");
0
by: tiggman | last post by:
Why preg_split works only if the char # before the delimiter is 21 or less? example php code: ============= $right = "{Hello Im very aaaaaa {cool|not cool}}"; print $right."<br>"; $pattern =...
10
by: RobinS | last post by:
Hello to all, and happy new year! I have this application that someone wrote that I'm sort of checking out. The forms look fine in design mode, but when I run the application, it crops off the...
2
by: sunday | last post by:
When trying to update a table, the following works only occasionally; it doesn't work reliably. Can anyone show me where I'm going wrong, please? // $commenrts_new is the data from the form ;...
12
by: d-42 | last post by:
Hi, How do I ask for escalation from within a program? I'm developing a standalone program that can also act as a 'plugin' to another application. The way the other app was designed, it scans...
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: 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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.