Click here to Skip to main content
15,885,757 members
Home / Discussions / C#
   

C#

 
GeneralRe: Draw line in RichTextBox C# Pin
DaveyM696-Sep-10 8:27
professionalDaveyM696-Sep-10 8:27 
QuestionMulti-threading and function recursion with a form [modified] Pin
fdsfsa76f7sa66-Sep-10 3:11
fdsfsa76f7sa66-Sep-10 3:11 
AnswerRe: Mulit-threading and function recursion with a form Pin
Pete O'Hanlon6-Sep-10 3:23
mvePete O'Hanlon6-Sep-10 3:23 
GeneralRe: Mulit-threading and function recursion with a form Pin
fdsfsa76f7sa66-Sep-10 4:17
fdsfsa76f7sa66-Sep-10 4:17 
GeneralRe: Mulit-threading and function recursion with a form Pin
Kubajzz6-Sep-10 4:31
Kubajzz6-Sep-10 4:31 
GeneralRe: Mulit-threading and function recursion with a form Pin
fdsfsa76f7sa66-Sep-10 5:13
fdsfsa76f7sa66-Sep-10 5:13 
GeneralRe: Mulit-threading and function recursion with a form Pin
Pete O'Hanlon6-Sep-10 4:59
mvePete O'Hanlon6-Sep-10 4:59 
AnswerRe: Mulit-threading and function recursion with a form Pin
Cracked-Down6-Sep-10 8:21
Cracked-Down6-Sep-10 8:21 
Use of AutoResetEvent is good idea by using Set and Waitone methods.

You will require two instance of AutoResetEvent, one is for triggering condition(in your case button click) and other is for waiting for triggering.
Have you ever heard about producer/consumer pattern? Your problem can be easily solved by using this pattern. This pattern can be implemented in conditions where you have one thread producing the data and other thread consuming it. I cant make it out from your example whether the background worker is producing data or not (but i am sure it must be).

I would suggest you to go and search for this pattern you will get many good articles describing this pattern.

some of them are
www.albahari.com/threading/part2.aspx


Producer/Consumer Implementation Using Thread,Semaphore and Event


I hope this helps you to solve your problem Smile | :)

oops...I forgot to mention that recursive is not required if you use the above pattern use while(someflag){} instead.


Best Regards,
AD
AnswerDammit, stop blabbing and give him the code already... Pin
lepipele7-Sep-10 4:53
lepipele7-Sep-10 4:53 
GeneralRe: Dammit, stop blabbing and give him the code already... Pin
lepipele7-Sep-10 5:10
lepipele7-Sep-10 5:10 
GeneralRe: Dammit, stop blabbing and give him the code already... Pin
fdsfsa76f7sa69-Sep-10 1:27
fdsfsa76f7sa69-Sep-10 1:27 
GeneralRe: Dammit, stop blabbing and give him the code already... Pin
lepipele9-Sep-10 6:20
lepipele9-Sep-10 6:20 
QuestionRe: Dammit, stop blabbing and give him the code already... [modified] Pin
fdsfsa76f7sa69-Sep-10 22:37
fdsfsa76f7sa69-Sep-10 22:37 
AnswerRe: Dammit, stop blabbing and give him the code already... Pin
lepipele13-Sep-10 9:30
lepipele13-Sep-10 9:30 
GeneralRe: Dammit, stop blabbing and give him the code already... Pin
fdsfsa76f7sa67-Sep-10 5:24
fdsfsa76f7sa67-Sep-10 5:24 
QuestionWindows Task Scheduler problem Pin
Tridip Bhattacharjee6-Sep-10 1:45
professionalTridip Bhattacharjee6-Sep-10 1:45 
AnswerRe: Windows Task Scheduler problem Pin
Pete O'Hanlon6-Sep-10 2:12
mvePete O'Hanlon6-Sep-10 2:12 
GeneralBSCS FINAL PROJECT Pin
HUSSNAIN TOUFIQ6-Sep-10 0:53
HUSSNAIN TOUFIQ6-Sep-10 0:53 
GeneralRe: BSCS FINAL PROJECT PinPopular
OriginalGriff6-Sep-10 0:57
mveOriginalGriff6-Sep-10 0:57 
GeneralRe: BSCS FINAL PROJECT Pin
dan!sh 6-Sep-10 0:58
professional dan!sh 6-Sep-10 0:58 
GeneralRe: BSCS FINAL PROJECT Pin
Eddy Vluggen6-Sep-10 1:14
professionalEddy Vluggen6-Sep-10 1:14 
GeneralRe: BSCS FINAL PROJECT PinPopular
J4amieC6-Sep-10 1:28
J4amieC6-Sep-10 1:28 
GeneralRe: BSCS FINAL PROJECT Pin
DaveyM696-Sep-10 1:35
professionalDaveyM696-Sep-10 1:35 
GeneralRe: BSCS FINAL PROJECT Pin
Smithers-Jones6-Sep-10 2:12
Smithers-Jones6-Sep-10 2:12 
GeneralRe: BSCS FINAL PROJECT PinPopular
Pete O'Hanlon6-Sep-10 2:25
mvePete O'Hanlon6-Sep-10 2:25 

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.