Click here to Skip to main content
15,885,767 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Desktop background Pin
The real $M@14-Jul-09 5:25
The real $M@14-Jul-09 5:25 
Questiontv tuner and directShow Pin
gsipes30-Jun-09 3:30
gsipes30-Jun-09 3:30 
QuestionMultithreading confusion Pin
Sonhospa30-Jun-09 2:59
Sonhospa30-Jun-09 2:59 
AnswerRe: Multithreading confusion Pin
Luc Pattyn30-Jun-09 3:19
sitebuilderLuc Pattyn30-Jun-09 3:19 
QuestionRe: Multithreading confusion Pin
Sonhospa30-Jun-09 10:04
Sonhospa30-Jun-09 10:04 
AnswerRe: Multithreading confusion Pin
Luc Pattyn30-Jun-09 10:24
sitebuilderLuc Pattyn30-Jun-09 10:24 
GeneralRe: Multithreading confusion Pin
Sonhospa1-Jul-09 10:31
Sonhospa1-Jul-09 10:31 
GeneralRe: Multithreading confusion Pin
Luc Pattyn1-Jul-09 11:03
sitebuilderLuc Pattyn1-Jul-09 11:03 
Hi,

Forms don't need threads, they can't make good use of threads, since anything that happens to a Form (i.e. calling properties and methods of Controls) has to be executed by the main thread.

Classes in general may make good use of threads for things that take long or might take long, such as complex computations, networking, large file operations, database accesses, etc.

So you should design your class/classes as if they were running on the main thread; then isolate the long running stuff and delegate that to another thread or BackgroundWorker, which could feed back intermediate results to the main thread for showing them on a GUI. There is an infinite number of ways to do that. If a lot of results need to be fed back, you could design a small "Results" class, have your BGW create and fill an instance, then put it in some queue, and have the main thread get it and process it, i.e. display it. You may or may not use the Progress event for that, I typically don't use it; instead, I often tend to create a delegate and call that.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.

GeneralRe: Multithreading confusion Pin
Sonhospa1-Jul-09 20:20
Sonhospa1-Jul-09 20:20 
QuestionHow to connect DB in Lan Connection? Pin
JC.KaNNaN30-Jun-09 2:25
JC.KaNNaN30-Jun-09 2:25 
AnswerRe: How to connect DB in Lan Connection? Pin
Aman Bhullar30-Jun-09 3:25
Aman Bhullar30-Jun-09 3:25 
GeneralRe: How to connect DB in Lan Connection? Pin
loid grey manuel24-Mar-11 6:20
loid grey manuel24-Mar-11 6:20 
AnswerRe: How to connect DB in Lan Connection? Pin
Dave Kreskowiak30-Jun-09 3:47
mveDave Kreskowiak30-Jun-09 3:47 
QuestionAlgin Left in Excel Export from VB.net Application Pin
maddylein29-Jun-09 21:30
maddylein29-Jun-09 21:30 
AnswerRe: Algin Left in Excel Export from VB.net Application Pin
dan!sh 29-Jun-09 21:48
professional dan!sh 29-Jun-09 21:48 
GeneralRe: Algin Left in Excel Export from VB.net Application Pin
maddylein29-Jun-09 22:21
maddylein29-Jun-09 22:21 
QuestionHow to convert an exe into a service Pin
RK11@200929-Jun-09 19:29
RK11@200929-Jun-09 19:29 
AnswerRe: How to convert an exe into a service Pin
Christian Graus30-Jun-09 0:18
protectorChristian Graus30-Jun-09 0:18 
GeneralRe: How to convert an exe into a service Pin
paas30-Jun-09 2:44
paas30-Jun-09 2:44 
GeneralRe: How to convert an exe into a service Pin
Jon_Boy30-Jun-09 4:15
Jon_Boy30-Jun-09 4:15 
GeneralRe: How to convert an exe into a service Pin
Christian Graus30-Jun-09 10:32
protectorChristian Graus30-Jun-09 10:32 
AnswerRe: How to convert an exe into a service Pin
Dave Kreskowiak30-Jun-09 1:35
mveDave Kreskowiak30-Jun-09 1:35 
AnswerRe: How to convert an exe into a service Pin
gsipes30-Jun-09 3:01
gsipes30-Jun-09 3:01 
QuestionHelp Me Pin
hamed200929-Jun-09 17:39
hamed200929-Jun-09 17:39 
AnswerRe: Help Me Pin
dan!sh 29-Jun-09 19:16
professional dan!sh 29-Jun-09 19:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.