Click here to Skip to main content
16,006,378 members
Home / Discussions / C#
   

C#

 
GeneralRe: ComboBox Pin
zaboboa8-Aug-05 3:25
zaboboa8-Aug-05 3:25 
GeneralRe: ComboBox Pin
Alomgir Miah8-Aug-05 4:02
Alomgir Miah8-Aug-05 4:02 
GeneralRe: ComboBox Pin
Mohamad Al Husseiny8-Aug-05 4:05
Mohamad Al Husseiny8-Aug-05 4:05 
GeneralCreating DTS Packages in C# Pin
JMichael24688-Aug-05 3:05
JMichael24688-Aug-05 3:05 
GeneralRe: Creating DTS Packages in C# Pin
JMichael24688-Aug-05 8:27
JMichael24688-Aug-05 8:27 
Generalreading XML from a string Pin
Mridang Agarwalla8-Aug-05 3:01
Mridang Agarwalla8-Aug-05 3:01 
GeneralRe: reading XML from a string Pin
Anonymous8-Aug-05 4:14
Anonymous8-Aug-05 4:14 
GeneralMultiple calls to same function Pin
Dwayner798-Aug-05 2:33
Dwayner798-Aug-05 2:33 
I asked the question friday, and am gettign to it today. The original question was:

I have two controls each of which have loops (we will call loop 1 and loop 2) that call a central function that sends and gets data via serial (we will call Communication function). Only one loop is to run at a time. The problem I am having is when the user requests loop 2 while loop 1 just started. Loop 2 alerts loop 1 to stop, but if loop 1 just started, it will still be calling the communication function until it finishes.

I hope this is makeing sense...

Meanwhile, loop 2 has started calling communication function as well and I am getting overlap. I cannot simple set a bit and exit the loop at the end. (It is a big program so you will just have to trust me.)

Is there a way to cache the values needed to be sent to the communications function?

Is there a clean way to exit a loop without it finishing?

Should I be focussing on trying to make the two (in reality 10) different loops NEVER call until all other loops are inactive, or should I be trying to make the communication function able to handle multiple calls?

Peter V. mentioned Mutex which I tried and is not working. I believe it is not working because each loop is creating a new instance of the Communication function. But is this were true, wouldn't the program treat each instance seperately. Thanks again in advance.

*****************
"We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
GeneralRe: Multiple calls to same function Pin
Alomgir Miah8-Aug-05 10:44
Alomgir Miah8-Aug-05 10:44 
GeneralRe: Multiple calls to same function Pin
Dwayner799-Aug-05 5:21
Dwayner799-Aug-05 5:21 
QuestionInsert Null to Foxpro table with DataSet? Pin
Member 18559638-Aug-05 1:49
Member 18559638-Aug-05 1:49 
GeneralWebBrowser security level Pin
gnjunge8-Aug-05 1:27
gnjunge8-Aug-05 1:27 
Generalcreating a programming software package Pin
Atmadarshini8-Aug-05 1:17
Atmadarshini8-Aug-05 1:17 
GeneralRe: creating a programming software package Pin
Steve S8-Aug-05 1:40
Steve S8-Aug-05 1:40 
GeneralRe: creating a programming software package Pin
Atmadarshini8-Aug-05 1:45
Atmadarshini8-Aug-05 1:45 
GeneralRe: creating a programming software package Pin
Steve S15-Aug-05 0:37
Steve S15-Aug-05 0:37 
Generalview Pin
magnifique8-Aug-05 1:05
magnifique8-Aug-05 1:05 
GeneralRobocopy C# Pin
NitinR8-Aug-05 0:36
NitinR8-Aug-05 0:36 
GeneralRe: Robocopy C# Pin
gnjunge8-Aug-05 1:36
gnjunge8-Aug-05 1:36 
GeneralRe: Robocopy C# Pin
NitinR8-Aug-05 1:41
NitinR8-Aug-05 1:41 
GeneralRe: Robocopy C# Pin
Member 77568542-Jun-11 5:13
Member 77568542-Jun-11 5:13 
GeneralREGEX Pin
tatchung8-Aug-05 0:02
tatchung8-Aug-05 0:02 
GeneralRe: REGEX Pin
J4amieC8-Aug-05 0:31
J4amieC8-Aug-05 0:31 
GeneralRe: REGEX Pin
Mohamad Al Husseiny8-Aug-05 1:15
Mohamad Al Husseiny8-Aug-05 1:15 
GeneralRe: REGEX Pin
Guffa8-Aug-05 2:10
Guffa8-Aug-05 2:10 

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.