Click here to Skip to main content
15,892,537 members
Home / Discussions / C#
   

C#

 
GeneralRe: Plugin 'System.Reflection.TargetInvocationException' While Passing Event Pin
John Torjo27-Oct-15 10:59
professionalJohn Torjo27-Oct-15 10:59 
GeneralRe: Plugin 'System.Reflection.TargetInvocationException' While Passing Event Pin
Eddy Vluggen27-Oct-15 12:36
professionalEddy Vluggen27-Oct-15 12:36 
QuestionWhy my .NET application is crashing?! Pin
Jassim Rahma26-Oct-15 23:42
Jassim Rahma26-Oct-15 23:42 
AnswerRe: Why my .NET application is crashing?! Pin
Pete O'Hanlon27-Oct-15 0:00
mvePete O'Hanlon27-Oct-15 0:00 
AnswerRe: Why my .NET application is crashing?! Pin
John Torjo27-Oct-15 1:45
professionalJohn Torjo27-Oct-15 1:45 
AnswerRe: Why my .NET application is crashing?! Pin
Dave Kreskowiak27-Oct-15 2:29
mveDave Kreskowiak27-Oct-15 2:29 
QuestionWorking on multithreading application Pin
Member 1132358526-Oct-15 23:39
Member 1132358526-Oct-15 23:39 
AnswerRe: Working on multithreading application Pin
Daniel Pfeffer27-Oct-15 1:23
professionalDaniel Pfeffer27-Oct-15 1:23 
Synchronization is essential when you have one thread modifying a datum while another thread is reading it. If I understand your design correctly, you have the following threads:
  1. The GUI thread (reads the shared structure and displays the map)
  2. Working thread(s) (update and sort the shared structure)
You may only have one GUI thread in a program, so the number of readers is fixed. The number of writers is variable, but unless there are special conditions that you are not telling us about - one writer thread should be sufficient.

Locking/Synchronisation between the two threads is left as an exercise for the student. Smile | :) Look up "Threads" and "Synchronisation Primitives" in any decent C# book.

The best way to terminate the working thread is to set some sort of flag that is checked by the working thread, which causes the thread to shut itself down cleanly. Terminating a thread any other way is asking for trouble.
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.

--Winston Churchill

GeneralRe: Working on multithreading application Pin
BillWoodruff27-Oct-15 3:29
professionalBillWoodruff27-Oct-15 3:29 
GeneralRe: Working on multithreading application Pin
Daniel Pfeffer27-Oct-15 4:05
professionalDaniel Pfeffer27-Oct-15 4:05 
AnswerRe: Working on multithreading application Pin
Foothill27-Oct-15 4:30
professionalFoothill27-Oct-15 4:30 
AnswerRe: Working on multithreading application Pin
Gerry Schmitz27-Oct-15 7:23
mveGerry Schmitz27-Oct-15 7:23 
Questionnew to C# Pin
Member 1206164726-Oct-15 18:39
Member 1206164726-Oct-15 18:39 
AnswerRe: new to C# Pin
Garth J Lancaster26-Oct-15 19:34
professionalGarth J Lancaster26-Oct-15 19:34 
AnswerRe: new to C# Pin
John Torjo26-Oct-15 19:51
professionalJohn Torjo26-Oct-15 19:51 
AnswerRe: new to C# Pin
OriginalGriff26-Oct-15 22:50
mveOriginalGriff26-Oct-15 22:50 
AnswerRe: new to C# Pin
BillWoodruff27-Oct-15 1:43
professionalBillWoodruff27-Oct-15 1:43 
Questionchart axis offset when reflesh data Pin
smallkubi26-Oct-15 1:29
smallkubi26-Oct-15 1:29 
AnswerRe: chart axis offset when reflesh data Pin
John Torjo26-Oct-15 6:06
professionalJohn Torjo26-Oct-15 6:06 
QuestionI have this code in C # more people basic_info returns 0!? Can someone help me? Pin
Member 1208599525-Oct-15 9:05
Member 1208599525-Oct-15 9:05 
AnswerRe: I have this code in C # more people basic_info returns 0!? Can someone help me? Pin
BillWoodruff25-Oct-15 9:13
professionalBillWoodruff25-Oct-15 9:13 
GeneralRe: I have this code in C # more people basic_info returns 0!? Can someone help me? Pin
Member 1208599525-Oct-15 9:24
Member 1208599525-Oct-15 9:24 
GeneralRe: I have this code in C # more people basic_info returns 0!? Can someone help me? Pin
BillWoodruff25-Oct-15 11:25
professionalBillWoodruff25-Oct-15 11:25 
AnswerRe: I have this code in C # more people basic_info returns 0!? Can someone help me? Pin
Member 1208599525-Oct-15 9:18
Member 1208599525-Oct-15 9:18 
GeneralRe: I have this code in C # more people basic_info returns 0!? Can someone help me? Pin
Member 1208599525-Oct-15 9:23
Member 1208599525-Oct-15 9:23 

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.