Threads Program Uses To Scape List Faster?

Nov 22, 2011

Im making program that scrapes things from big url list, is it possible to make user set how many threads program uses to scape list faster? If its possible,

For each url as object in urllist.items Do something.Next If can be made into that, would be nice :P

View 9 Replies


ADVERTISEMENT

Using Multiple Threads For Faster Execution?

Jan 27, 2012

I have a map image with data associated with the map indicated by RGB index. The data has been populated into an MS Access database. I imported the information in the database into my program as an array and sorted them to go in the order I want the program to run.

I want the program to find the nearest pixel that has a different color from the incumbent pixel being compared. (Colors are stored as string attributes of object Pixel)

First question: Should I use integers to represent my colors instead of string? Would this make the comparison function run significantly faster?

In order to find the nearest pixel of different color, the program begins with all 8 adjacent pixels around the incumbent. If a nonMatch is not found, it then continues onto the next "degree", and in this fashion, it spirals out from the incumbent pixel until it hits a nonMatch. When found, the color of the nonMatch is saved as an attribute of incumbent. After I find the nonMatch for each of the Pixels, the data is re-inserted into the database

The program accomplishes what I want in the manner I've written it, but it is very very slow. After 24 hours, I am only about 3% through with execution.

Question Two: Does my program behavior sound about right? Is this algorithm you would use if you had to accomplish this task?

Question Three: Would it be appropriate for me to use threads in order to finish execution of the program faster? How exactly does that work?

Question Four: Would it be more "intelligent" for my program to find the nonMatch for each pixel and insert it into the database immediately after finding it? (I'm making a guess that this would be good in multi-threading, because while one record is accessing the database (to insert), another record is accessing the array of pixels (shared global variable in program).

Question Five: If threading is a good idea, I'm guessing I would split the records up into more manageable chunks (i.e. quarters), and have each thread run the same functions for their specified number of records? Am I close at all?

View 3 Replies

Is Running Multiple Threads Faster Then A Single Thread On A Single Core Cpu

Dec 23, 2009

Say I have a code with 3 methods that do some pretty intensive work. Would executing these methods on 3 seperate threads be faster then executing them one after the other on a single core cpu? And what if it's a dual core or HT?

View 8 Replies

List Fonts Used By A Word Document (faster Method)?

Mar 10, 2011

I am working on process for validating documents to make sure that they meet corporate standards. One of the steps is to make sure that the Word document does not use non-approved fonts.I have the following stub of code, which works:

Dim wordApplication As Word.ApplicationClass = New Word.ApplicationClass()
Dim wordDocument As Word.Document = Nothing
Dim fontList As New List(Of String)()

[code]....

View 2 Replies

Close The Form By Pressing The Scape Button?

Sep 29, 2010

How can I close the form by pressing the scape button? I know I can put a button on form and set the form CancelButton to this button, but is there another way without placing that button?

View 3 Replies

Make Program Run Faster?

Jun 13, 2010

Ok well i have a code that makes a bitmap the size of 9000,9000 but it makes the program run so slow. how to make it run faster?

View 5 Replies

Make The Program Faster?

Jun 27, 2012

*i have a vb.net application that plots 16 plots immediately, the plots data are realtime. the 16 plots must draw the points at the time they receive them (must be no delay), to do that 1- i made a timer with ticks at 50 ms.2- at each timer tick call the plotting function 16 times (with a graph name as parameter)like that:

[Code]...

View 1 Replies

Best List For 2 Threads?

Jun 10, 2010

I have 2 thread.One that put some data inside a list?the second that take out these data from the same list.what is the best "list" that allows one thread to put something inside and another one that take stuff out>

View 1 Replies

Program Runs Faster In Background?

Jun 28, 2010

this is really bothering me, my program seems to run faster whenever I click on some other window so the form doesn't have focus. What is going on and how can I fix this?

Here's the troublesome section:
ListView1.Items.Clear()
'loop through the updates

[code].....

View 2 Replies

VS 2008 How To Make Program Faster

Apr 7, 2011

Since i have a background on my progam it is very slow. You got a code to make it faster?

View 2 Replies

Get An Ongoing List Of Your Threads In Forum?

Mar 25, 2012

I found it quite difficult to find a thread from a few months back as I wanted to use the URL to that thread to show in another today. If you're willing to update this periodically (it'll only keep the last 100 of your threads/replies), this might get you started on a way to save them on your computer from now on.

Start by clicking on your own name (you can also use go to "View Profiles" and find it), then look for the following

[code]...

View 2 Replies

Adding Text To A List View From Threads

Jun 17, 2011

I am new to VB and I am trying to add text from a thread to a listview in my Form1.I have tried implementing the invokerequired method but still the new text is not added to my listview.[code]The new text that I add is not displayed in the listview. I do not get any compile or runtime errors but still no new text to list box. I can add text from my Form1 class but not from the thread.

View 1 Replies

C# - Access The List Of Words Of A Word Document From Multiple Threads?

Mar 18, 2011

I recently had some problems with the performance of the Word object model. In an add-in that I wrote for Word I need to parse through all the words of a document and replace some of them or ask the user for the ones that have multiple replacements. I know that it is faster to ask Word for all of the document text content at once and then process it and put it back all at once again, but this is not suitable for my add-in because I need to have access to the range objects that represent the words that have multiple replacements so that I can somehow mark them in the document and present the user with a tool tip from which he can select the replacement he wants.

So for the moment the single great speed improvement that came in my head was multithreading since most people already have dual core or better. The problem is that all the things you find on Google say that multithreading in Office is a very bad thing to do.

So is there any one who managed to do this in a manner that worked in most of its usage? By this I mean if it also worked on other PCs then the development one?

View 1 Replies

.net - Multithreading Function To Implement Threads Fetching From A List Of Urls To Parse Content?

Feb 2, 2010

I have the following multithreading function to implement threads fetching from a list of urls to parse content. The code was suggested by a user and I just want to know if this is an efficient way of implementing what I need to do. I am running the code now and getting errors on all functions that worked fine doing single thread.for example now for the list that I use to check visited urls; I am getting the 'argumentoutofrangeexception - capacity was less than the current size'/Does everything now need to be synchronized?

Dim startwatch As New Stopwatch
Dim elapsedTime As Long = 0
Dim urlCompleteList As String = String.Empty

[code]...

View 2 Replies

Why Does A Nearly Empty VB.NET Program Use 4 Threads?

Mar 17, 2011

I just noticed after adding the threads column in task manager to Win7 that a fresh new VS2005 project with single form and no code compiles and runs with 4 threads. Does anyone else notice this? Can anyone tell me why?

View 3 Replies

.net - Feedback From Threads To Main Program?

Jan 27, 2011

My software will simulate a few hundred hardware devices, each of which will send several thousand reports to a database server.Trying it without threading did not give very good results, so now it's time to thread.Since I am load testing the d/b server, some of those transactions will succeed and a few may fail. The GUI of the main program needs to reflect this. How should the threads communicate their results back to the main program? Update global variables? Send a message? Or something lese?

Now, if I update only at the end of each thread then the GUI is going to look rather boring (and I can't tell if the program hung). It might be nice to update the GUI periodically. But that might cause contention, with threads waiting for other threads to update (for instance, if I am writing to global variables, I need a mutex, which will block each thread which is waiting to write).

I'm new to threading. How is this normally done? Perhaps the main program could poll the threads, instead of the threads iforming the main program?

View 1 Replies

Maximum Threads Usage In A Program

Jan 27, 2010

Maximum threads usage in a program

View 4 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

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

VS 2010 - Creating New Threads From Set Amount In Program?

Jun 1, 2011

How do I make my program create new threads from a set amount? For example if someone typed "60" in a textbox and they pressed "Start", it would create 60 threads that would do the same function.

View 5 Replies

Create Multiple Threads To Improve A Function On Program

Sep 7, 2011

i need to create multiple threads to improve a function on my program. it is a simple thing really but it's slow and if multithreaded it can improve the speed some thousand times. my program uses a dll to check the MX record of an e-mail from a textbox called emails if the mx record is correct then it validates that domain, if not, it sends to an error textbox with that mail my problem is that im reading a lot on multithreading and i dont have an idea how to make something like this: for x=0 to emails.lines.count -1' start a thread that runs my function next if i can limit the number of threads to avoid crashing it would be good.

View 5 Replies

Should Threads Update Global Data In The Main Program

Mar 18, 2011

I want to launch a bunch of threads, each performing the same task, and know in main() when each finishs and it if it was successful or failed.The solution offered was to use a ConcurrentQueue, but other posts have recommended using a BackgroundWorker Class, or a thread pool.Is there a definitive answer?Again, all threads perform the same code and have a pass/fail result. I want to run more than there are available threads so as soon as one thread finishes I will launch another asap - I want tehm to stress a remote systems as much as possible (reather than stressing my local PC with too many threads, so I will need to experiment to determine the optimal number of threads).

View 4 Replies

Program That Will Compare Array Of Grocery List Items Glist And Array Of Coupon Item List

May 27, 2012

I have a program that will compare an array of grocery list items glist and an array of coupon item clist.When I compare the two and if there is a match somewhere in the array I want to have a picturebox visible.When there is no match, I want the picture box not to be visible. [code] The code seems to work great until I come to the else statement.When the code finds a match it displays the picture box and the msgbox without error, but as soon as the message box is cleared, even though i've input it as an ELSE statement, the picturebox goes false again.Does anyone have any idea of how I can "hold" the picturebox to stay visible while the match between the arrays exists?

View 18 Replies

Is C# Faster Than .NET

Oct 1, 2010

You'd think both are the same. But maybe it's the compiler that Microsoft has used, but I've noticed that when compiling two very small programs, identical logic. VB.NET uses more IL instructions.Is it true than that c# must be faster, if only because its compiler is smarter.

View 6 Replies

Which One Is Faster, C# Or .net

Feb 15, 2011

Possible Duplicate: Is C# faster than VB.NET? Which one is faster, C# or Vb.net ?

View 2 Replies

Faster Than A Listview?

Mar 11, 2011

A long time a agp I settled into a listview as an indicating device. I do not use pictorial modes or graphics. Just listing and multicolumn listing.I am also a performance bug and I have written realtime monitors for monitoring cpu activity in real-time and normally rum them starting at bootime. Lately I have found that the listview throws away time. In a tight loop, the list view does not take all cpu time available and the listview is relatively slow.

Does anyone know of a control like the list views only it's faster? Multi-colored and multi-columned are musts.

View 5 Replies

Faster Way To Filter?

Jun 22, 2010

I have a simple application, a form with two datepicker( Datepicker1 is for startsearchdate, while datepicker2 is endsearchdate) to filter out any record that not in the range. The source of the record is readed from a rtf file.The record is in format as showm below.[code]...

View 9 Replies

Foreach In Faster Than In C#?

Mar 12, 2009

My co-worker said that in a previous interview, he learned that foreach is faster in VB.Net than c#'s foreach. He was told that this was because both have different CLR implementation.

Coming from a C++ perspective, I'm curious on why this is and I was told that I need to read up on CLR first. Googling foreach and CLR doesn't help me understand.

Does anyone have a good explanation on why foreach is faster in VB.Net than in c#? Or was my co-worker misinformed?

View 5 Replies

How To Get Filename Faster

Mar 29, 2010

I have a directory with more then 350.000 files in. I need to process every single file and move them to an other folder. When I use the dir() method it takes a few seconds before if it returns the first file found.
dim foundfile as string = dir("d:")

In the documentation there is this:
"The My.Computer.FileSystem Object gives you greater productivity and performance in file I/O operations than the Dir function. See My.Computer.FileSystem.GetDirectoryInfo Method for more information."

But I can't find any method that is faster then dir, and gives the same result. I can't use this method below because it takes for ever to load......
For Each foundFile As String In My.Computer.FileSystem.GetFiles("D:")
Next
It just does not work fast...

When I use the Dir() method it takes like 5 sec, and it uses 100% cpu... it is just not a option. How do I get the same function as the dir method but better performance? (I use visual basic 2008).

View 8 Replies

Asp.net - Create CSV File Faster

Apr 13, 2011

I create a CSV file by getting a datatable then looping through that datatable and writing eachline of a CSV file. My data source usually has around 65,000 rows in it. This process takes several minutes to download from the browser. The problem is that locally and on dev it doesn't take too long, but on the client they usually timeout.

Is there a faster way to generate this file?

Function GenerateCSVFile() As String
Dim stuPro As New studentProvider.StudentProvider
Dim emailCenter As New EmailCenter

[Code].....

View 5 Replies







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