VS 2008 - Use Threads In Loop To Make The Application Less CPU-intensive?

May 4, 2009

I am trying to stop the following piece of code from taking up too much processing power of the PC by using threads. But I keep getting errors when I use threads:

[Code]...

View 3 Replies


ADVERTISEMENT

Queue Threads - Spawn A Series Of 'child' Threads From A Loop

Dec 30, 2009

I have a main thread which is designed to be a batch processor - it spawns a series of 'child' threads from a loop (which can vary in terms of the no of items) - see below

[Code]...

However, each of the 'child' threads could take anywhere from milliseconds to about a minute to process - depending on the complexity of each calculation. There may also be a large number of child threads - e.g 100s. Creating large numbers of child threads is not efficient. I therefore want some way to effectively queue each child thread (and cancel if the process is taking too long to complete). Autoevents seems like one way of doing this, but the only examples I can find seem to assume there are two different processes on seperate threads, not one process being repeated.

View 4 Replies

C# - ASP.Net - Create An Application That Has The Potential To Be Very Performance Intensive

Jan 9, 2010

Until now, I have not create any massive applications using ASP.Net. However, I am looking to create an application that has the potential to be very performance intensive. So I am looking for some tools or best practices when it comes to performance. I would like to be able to know how to:

See my current performance (good or bad) View items that need fixing And being able to compare two performance variable items would be great as well.

View 2 Replies

VS 2008 Make Some Kind Of Loop Inside A Timer To Make Them Change?

Dec 14, 2010

Basically I have 10 .png images.They contain a walk cycle I need to make some kind of loop inside a timer to make them change.

View 2 Replies

Create Many Objects (threads) In Loop?

Jun 17, 2011

threads that watch folders and process files. This works fine, but every time needs change to add a new folder or just change some existing rules I have to go in and change the program. I want to builda front end that storesprocessing infofor each watchfolder. The program would then read the configs and build the threads based on them. I cannot find a way to loop through creating the threads.

View 8 Replies

VS 2008 - Make A Loop From 1 To 100 And Make It Everytime It Loops Display Incrementing Numbers To The Screen?

Aug 23, 2009

How do I make a loop from 1 to 100 and make it everytime it loops display incrementing numbers to the screen?

View 1 Replies

Creating And Starting Threads In A Loop With Parameters

Apr 29, 2010

I have ran into a situation where it would be a lot faster to create a thread by the users demand. Basically, what I have is some kind of downloading program which grabs URLs from the clipboard into a DataGridView. Now when multiple URL's have been added, it becomes really inefficient since only one URL is being processed at a time.Now what I wanted to do is, create a thread for each URL. The parameter for each thread are the URLs which are stored as strings inside the DataGridView rows.[code]

View 3 Replies

Multithreading - Speed Up Loop Through Additional Threads?

Dec 27, 2010

I have problem with multithreading.

For:

Code:

and multithreading to loop for:

Code:

How can I speed up this loop through additional threads?

I tried:

Code:

How can I do?

View 10 Replies

Create A Loop That Will Declare And Start Multiple Threads?

May 30, 2011

Basically with the code below I would like to create multiple threads. Let's say user input was the number 100 for the "userVal" variable of type integer. With the first pass of the loop, starting with 1, I would like to[code]...

View 10 Replies

Make Application Working Better And Never Freeze / Make Application Working With Any Count For Loop Without Freeze

Jan 19, 2012

I'm using loop to read data from sql and then make some calculations then save it again to another table but when application loop for 3 or 4 times it's freeze but the job is done but if loop = 10 or more then it is freeze and hangup for long time .i need to learn how to make my application working better and never freeze and make application working with any count for loop without freeze .

View 7 Replies

VS 2008 Make A Loop Of Generating Codes?

May 10, 2009

I wanted to know how to make a loop of generating codes, that I create (from the push of button1) Like this:

Dim MsgBox As String
MsgBox = ("My code here, not a random one")
TextBox1.Text = MsgBox

I want the textbox's code to change into another code, that i want, from the push of button1?

View 23 Replies

.NET 2008 Application Crashing During Do Loop?

Jun 4, 2010

I am writing an application to compare each item on listbox1 to all items on listbox2. If the item is found, then remove it from both lists. The goal is to only have the items that were not found remain on both lists.

The problem is, the application just hangs and I never get any results. I looked at my code several times and I cannot figure out what's going on (programming noob I know.

[Code]...

View 4 Replies

IDE :: Running A Disk Intensive Process With Feedback?

Feb 12, 2011

I have a module which performs a database intensive process (moves records from the current database to another database) Sometimes it can take a few minutes to run.What is the best practice for providing my user with feedback on the process and the ability to try and cancel the operation?Currently I have recently converted the module to Class which raises events as it progresses. I load a form, declare the class, then call a routine in the class to run the process, receiving feedback in the top level form?

View 3 Replies

Less Memory Intensive Way To Estimate Size Of A Testbox In .net?

Jun 8, 2012

I am currently using following code to estimate the size of the textbox:

Dim i As Integer, j As Integer, pGr As Graphics, sz As SizeF
For i = 1 To pNumRows
For j = 1 To pWidth
sb.Append("W")
Next

[Code]...

I was wondering if there is any way to remove the for-loops and do away entirely with the pGr (textbox.CreateGraphics) method and still correctly estimate the size of the textbox.If you're wondering why I am (actually the person who wrote the code) is looping through all the 'W', it's because (I think) 'W' has the biggest width and height in the entire character set, so the person (who wrote the code) is trying to guess the maximum area needed.

View 1 Replies

VS 2008 Make A Loop To Find All Texboxes On A Form?

May 14, 2009

I'm redoing a program I made up a while back and need some help changing a loop. The original program had all the text boxes on same form, the redesigned program still has them all on the same form but I have them spread across multiple tabs and the background of the form.

The code below loops through each possible text box and if it exists sets the value in an array. This only works for text boxes not on tabs. I found I could change the Me.Controls to TabPage1.Controls and that would get the text boxes on tabpage1. I would like to have a single loop that can find them on any tab and off the tabs, so I don't need three separate loops.

For num = 1 To 61
For Each controlctl In Me.Controls
If controlctl.Name = "TextBox" & CStr(num) Then

[Code].....

View 4 Replies

VS 2008 WMP Control - Make The Music Play Through It Loop

Jun 15, 2009

I added the WMP control to my project, but I can't figure out how to make the music I play through it loop!

View 1 Replies

VS 2008 Creating A Password Application With Do Loop

Oct 19, 2011

VS 2008 Creating a Password Application with Do Loop

View 4 Replies

Make 2 Threads In Server?

Jan 25, 2012

how i can make 2 threads in server ? "in server 2 threads . the first for + opration and seconed for x opration" client send to server 2 number and opration "+ or x"

[Code]...

View 3 Replies

Make Loop In Program And Calculate Time Taken To Complete Loop?

Nov 23, 2011

I am constructing a program, i am new to Visual Basic, but i have past programming experience. I was wondering if anyone knew how to form a loop that could...lets say calculate the answer when two numbers are added together,and it would repeat this thousands of times, etc. And if there is a way, would it be possible to calculate the time taken to complete this loop.

View 5 Replies

Find Threads In Application

Jun 7, 2011

I recently began working on an application that was built by someone that is no longer available. This application is filling an excel file, but I can not find ANY code that uses excel. There aren't even any references to excel interops. My thought is that this a multi-threaded application and I can't see what is going on behind the scenes. I tried watching the processes in the task manager, but found nothing.I've never worked with threads before, and do not even know where to begin. Debugging the program with breakpoints at multiple locations does not show me any of these other threads. Anyone have an idea on how to find/debug threads of a program?

View 1 Replies

Vb Application - Maximum No. Of Threads ?

Apr 22, 2010

I know increasing the no . of threads causes risk and many other issues bu i wanted to know what is the maximum no. of threads that my vb application could open..... and is there any way by which i can determine how many threads are currently open in my vb.net application?

View 5 Replies

VS 2008 Make One Application Send A Task To Another Application / Receive Result From That Secondary App?

Apr 26, 2010

is it possible to make one application send a task to another application and recieve the result from that secondary app?i made a text editor program and i added a scan feature and i made another app that has ocr capabilities.The scanner ability is in my text editor program, the ocr program doesnt scan you have to input an image into it and it will give text result a few seconds later.the prob is alot of times the ocr code uses sooo much memory and crashes when its incorporated with my text editor, but individually each application works fine and doesnt take too much memory. Memory wont be even an issue if the ocr program is standalone so that when it is done decoding image the application can be made to exit. now here is the question, how do i make my text editor send the image to the ocr program and how do i make my ocr program send the text back to my text editor? is it possible? i mean the only way i know off is creating temp files in a certain folder and having a timer on each program that keeps waiting for temp files. That just seems like pretty lame coding to me i was wondering if there's a better way?

View 11 Replies

Make The Connection For Threads To File Operations?

Nov 28, 2011

I have a small code that can start multiple threads in numerous numbers and these threads will perform some calculations and file operations (read and/or write) that are private to themselves (each of the calculations and file operations are independent).But I can not figure out how to make the connection for threads to file operations.

View 2 Replies

Forms Running In The Same Application But On Different Threads?

Dec 9, 2009

I have two forms running in the same application but on different threads. HdForm and DataForm. I have a class library whit datasets and a stack in it. Cause both forms (different threads try to rad from the same class library i use a synclock to syncronize. But it seems like the synclock dont work.I get random errors in the HdForm while reading from myAr dataset. It says index out of range. But i know for sure that the index exist (i have make sure of that). When i click on the visual studio play button then, it goes again.If the index was realy out of range then it couldn't go further. So i think the synclock does not work and thus the dataset is changed in time while im the loop reading from MyAr.

[Code]...

View 3 Replies

Implement Multiple Threads In Application

May 12, 2010

I need help to implement multiple threads in application.Assume ds.table(0) has 5 and sometime 6 rows rows for i=0 to ds.tables(0).rows.count-1.I have to apply multiple threads, means all five/six rows should start at once using thead and "Process 1" .."Process 4" should also handled by threads.This is hierarchy that I have to apply with threads, how can I do it. It is requested to put piece of code so I can understand better.

View 13 Replies

Make A Simultaneous Connection To Multiple Servers With Threads?

Mar 15, 2010

I want to make a simultaneous connection to multiple servers with threads, only to create a single connection.

Imports System.IO
Imports System.Net.Sockets
Imports System.Text

[Code].....

View 5 Replies

Way To Make Both Threads Continuously Fire Its Elapsed Event?

Feb 2, 2010

I'm using 2 System.Timers, which spawns a worker process during its elapsed event. If 1 of the events is busy doing something, the other thread elapsed event doesnt fire until the 1st thread has completed.Is there any way I can make both threads continuously fire its elapsed event??

View 3 Replies

Multithreading - .NET 4.0 Execute Multiple Threads But Threads Are Completed Before Resuming?

Oct 19, 2011

I just had a new, last-minute idea on to take on a task, so I am running to StackExchange for quick help.

What I want to do is execute a series of methods right in a row, each in their own threads. I want the application to wait until all of these threads are completed, after which the program will resume. It also has to use managed threading (thread pool).

What quick examples could you provide to help me along the way? If it's too complex, what things should I know about so that I can Google it on my own?

View 1 Replies

Use Threading In Application To Put Two Functionality In Two Separate Threads?

May 2, 2009

I have one applicatin developed in my ap i have two main functionalities

1)Copyig Folders & Files from one source to destination

2) And I am showing status of copying in richtextbox and progrss with progress bar

Here i need to use threading bcz i am copying files from one server to another server and some large size files while copying my application always gone to stuck and i am not able to see status of copying and progressbar so how i use threading in my applicatio to put two functionalitis in two seperate threads.

View 4 Replies

Consecutive Threads - Make A Multi-threading App Which Extracts The Names From Site

Mar 2, 2009

I'm trying to make a multi-threading app which extracts the names from my site. I have 1000 pages celebrity related. The urls are on a listbox List1 and the number of threads are specified in TextBoxThreads I would like each thread take care of a coresponding url on list, when they finish go to the next one and so on (for each thread a url)

[Code]....

View 10 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved