Click here to Skip to main content
15,891,473 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: program word document to a PDF Pin
Richard MacCutchan12-Nov-10 10:02
mveRichard MacCutchan12-Nov-10 10:02 
AnswerRe: program word document to a PDF Pin
Dr.Walt Fair, PE12-Nov-10 10:07
professionalDr.Walt Fair, PE12-Nov-10 10:07 
QuestionQuestion on threading Pin
svanwass12-Nov-10 8:41
svanwass12-Nov-10 8:41 
AnswerThread manager Pin
David Mujica12-Nov-10 9:33
David Mujica12-Nov-10 9:33 
GeneralRe: Thread manager Pin
svanwass12-Nov-10 9:57
svanwass12-Nov-10 9:57 
GeneralRe: Thread manager Pin
svanwass12-Nov-10 10:23
svanwass12-Nov-10 10:23 
GeneralRe: Thread manager Pin
Jason Christian17-Nov-10 6:06
Jason Christian17-Nov-10 6:06 
AnswerRe: Question on threading Pin
Luc Pattyn12-Nov-10 10:23
sitebuilderLuc Pattyn12-Nov-10 10:23 
Hi,

1.
Yes, you want the RunWorkerCompleted event handler to do something your main thread can notice. Lots of things are possible, here is one example:
have a global variable that is initialized to the number of jobs, and gets decremented (see Interlocked.Decrement) by each RunWorkerCompleted handler, which on top of that, by checking for zero, raises a signal (see e.g. ManualResetEvent)

2.
It is a bad idea to launch many BackGroundWorkers, as that would be too expensive. The better approach would be to have:
- a small number of BackGroundWorkers (say two times the number of cores your system has, Environment.ProcessorCount);
- a queue of jobs, filled by the main thread, and queried by those BackGroundWorkers (use a lock!);
- and probably a queue of results, filled by those BackGroundWorkers (use another lock), and emptied by the main thread when it gets its "all done" signal.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


GeneralRe: Question on threading Pin
svanwass16-Nov-10 6:30
svanwass16-Nov-10 6:30 
AnswerRe: Question on threading Pin
Luc Pattyn16-Nov-10 7:08
sitebuilderLuc Pattyn16-Nov-10 7:08 
GeneralRe: Question on threading Pin
svanwass16-Nov-10 9:24
svanwass16-Nov-10 9:24 
GeneralRe: Question on threading Pin
Luc Pattyn16-Nov-10 9:41
sitebuilderLuc Pattyn16-Nov-10 9:41 
GeneralRe: Question on threading Pin
svanwass16-Nov-10 9:50
svanwass16-Nov-10 9:50 
GeneralRe: Question on threading Pin
Luc Pattyn16-Nov-10 11:29
sitebuilderLuc Pattyn16-Nov-10 11:29 
AnswerRe: Question on threading Pin
Tieske817-Nov-10 1:43
professionalTieske817-Nov-10 1:43 
AnswerRe: Question on threading Pin
Spectre_00117-Nov-10 2:38
Spectre_00117-Nov-10 2:38 
GeneralRe: Question on threading Pin
svanwass17-Nov-10 4:52
svanwass17-Nov-10 4:52 
GeneralRe: Question on threading Pin
Spectre_00117-Nov-10 4:56
Spectre_00117-Nov-10 4:56 
AnswerRe: Question on threading [modified] Pin
SLDWorks17-Nov-10 18:59
SLDWorks17-Nov-10 18:59 
QuestionHow to populate a listbox from one listbox? Pin
waner michaud12-Nov-10 6:59
waner michaud12-Nov-10 6:59 
AnswerRe: How to populate a listbox from one listbox? Pin
Dr.Walt Fair, PE12-Nov-10 9:58
professionalDr.Walt Fair, PE12-Nov-10 9:58 
AnswerRe: How to populate a listbox from one listbox? Pin
Tarun.K.S15-Nov-10 19:28
Tarun.K.S15-Nov-10 19:28 
QuestionMulti-project solution with common DLLs Pin
vvincent12-Nov-10 5:17
vvincent12-Nov-10 5:17 
AnswerRe: Multi-project solution with common DLLs Pin
Dave Kreskowiak12-Nov-10 6:16
mveDave Kreskowiak12-Nov-10 6:16 
GeneralRe: Multi-project solution with common DLLs Pin
vvincent12-Nov-10 8:54
vvincent12-Nov-10 8:54 

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.