Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > Multithreading with vb safe?


Reply
 
Thread Tools Display Modes
  #1  
Old 07-29-2012, 07:28 PM
3dkingpin 3dkingpin is offline
Junior Contributor
 
Join Date: Feb 2008
Posts: 253
Default Multithreading with vb safe?


I run some code. it downloads a file then scans the text for certain keywords. It works fine with no threads.

I add threads to make it faster, so in each new thread a new download is started and the file is scanned using regex.

So if I set max num of threads to 5 at any one time there could be 5 downloads simultaneously.

What I found is that with 5 max threads after a while the pc starts makes bleeping noises from the box (not speakers)

Why is this. Normallly it is due to the GPU overheating. But the vb program harldy uses any graphics. So is it due to too many downloads or something im doing wrong? I did notice the grpx card temps go upto 60 degress but this cant be due to the program could it? If I run it on one or two thread it never has this problem

All downloads are run using httpwebrequest and all scans using regular expressions. All threads are run in the background and this is the code:

Code:
        Dim wc As New txtscan()
        wc.threadurl = url

        AddHandler wc.Scan_Finished, AddressOf Scan_FinishedEventHandler
        AddHandler wc.Scan_Update, AddressOf Scan_UpdateEventHandler

        Dim newthread As New System.Threading.Thread(AddressOf wc.getwords)
        newthread.IsBackground = True
        newthread.Priority = My.Settings.threadpriority
        activethreads += 1
        newthread.Start()
Any help is appreciated.
__________________
Hey, Looking for entry level job in VB net programming. Got basic qualification, years of programming experience (mainly self taught) and good portfolio. (UK)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->