Solved

C# - What is "tight loop code"?

Posted on 2013-01-29
4
540 Views
Last Modified: 2013-02-24
In the following article the author VB Rocks refers to "tight loop code". What is "tight loop code"?

http://www.codeproject.com/Articles/38555/WPF-ProgressBar

There are many situations where "tight loops" are required in code, such as when data is being read from a file. A standard coding approach is to open the file, then loop through the entire file, reading either lines, characters, or bytes in each pass. A progress bar may be used to report the progress of this operation.
0
Comment
Question by:jdana
4 Comments
 
LVL 42

Assisted Solution

by:sedgwick
sedgwick earned 116 total points
ID: 38831411
From Wiktionary:

(computing) In assembly languages, a loop which contains few instructions and iterates many times.
(computing) Such a loop which heavily uses I/O or processing resources, failing to adequately share them with other programs running in the operating system.
For case 1 it is probably like

for (unsigned int i = 0; i < 0xffffffff; ++ i) {}
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 117 total points
ID: 38831417
Looking at the article my opinion is that in a tight loop (in WPF) the interface is given no chance to update.
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 117 total points
ID: 38831801
A block of code which loops but does not release any resources during the loop.
0
 

Author Closing Comment

by:jdana
ID: 38923026
AndyAinscow and CodeCruiser - I agree, in the context of this article, "tight-loop" code is code that's opaque to other processes (and the GUI).
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question