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

Yielding time

Greetings to All,

I have a c# conversion app that does a lot of crunching and updates a status
window containing a RichText control. The updates to the control do not
appear until the job is done and the processor is freed up. I know in C++
you could pump some messages and the update would happen. I know in VB,
they had a call which would yield a minimum amount of time in order to
process events and update the display. What is available in C#?

Thanks in advance,
Kevin
Nov 15 '05 #1
3 1130
Kevin Chandler <Ke****@CoaxNoSpam.Net> wrote:
I have a c# conversion app that does a lot of crunching and updates a status
window containing a RichText control. The updates to the control do not
appear until the job is done and the processor is freed up. I know in C++
you could pump some messages and the update would happen. I know in VB,
they had a call which would yield a minimum amount of time in order to
process events and update the display. What is available in C#?


You should start the work in another thread, leaving the UI thread for
UI events. Note that any status updates or whatever should occur in the
UI thread too - use Control.Invoke to easily achieve this.

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

It worked great. I should have known better. Suffering from a brain-fade.

Kevin
Nov 15 '05 #3
"Kevin Chandler" <Ke****@CoaxNoSpam.Net> wrote:
I have a c# conversion app that does a lot of
crunching and updates a status window
containing a RichText control. [...]
I know in VB, they had a call which would yield
a minimum amount of time in order to process
events and update the display.


If you don't want to go the multi-threaded route, you can still use DoEvents
as you did in VB. The equivalent C# call is Application.DoEvents().

P.

--
www.CL4.org
Nov 15 '05 #4

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

Similar topics

8
by: Bart Nessux | last post by:
am I doing this wrong: print (time.time() / 60) / 60 #time.time has been running for many hours if time.time() was (21600/60) then that would equal 360/60 which would be 6, but I'm not getting...
3
by: Calvin Spealman | last post by:
I was wondering if it was possible, now or with a patch, to do either of the following: 1) Cause another thread's most recent function, or a given function in a given thread, to yield its...
5
by: David Stockwell | last post by:
I'm sure this has been asked before, but I wasn't able to find it. First off I know u can't change a tuple but if I wanted to increment a time tuple by one day what is the standard method to do...
2
by: One's Too Many | last post by:
Ran into a strange problem today: 8.1.7 on AIX 4.3.3 Database and applications had been working fine for two years and all of a sudden a couple of regularly-run queries are now no longer...
6
by: David Graham | last post by:
Hi I have asked this question in alt.php as the time() function as used in setcookie belongs to php - or does it belong equally in the javascript camp - bit confused about that. Anyway, can anyone...
6
by: Rebecca Smith | last post by:
Today’s question involves two time text boxes each set to a different time zone. Initially txtCurrentTime will be set to Pacific Time or system time. This will change with system time as we travel...
4
by: george | last post by:
I am writing a process that is a tight loop that consumes alot of cpu. Back in my VB days I could use "DoEvents" to periodically yield control to the OS incase there were any pending events. This...
7
by: (Jamie Andrews) | last post by:
For a research project, we're looking for a reliable parser for C that will take an ANSI C program and yield a tree representation of the program (as a Java or C++ object). Of course a grammar...
1
by: Troels Arvin | last post by:
Hello, I'm getting a large number of paragraphs like this in a db2diag.log: 2008-10-22-09.31.50.339542+120 I277626395A468 LEVEL: Warning PID : 1576968 TID : 1 ...
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:
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
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.