Click here to Skip to main content
16,007,610 members
Home / Discussions / C#
   

C#

 
AnswerRe: Serial Port Control [modified] Pin
stancrm23-May-06 20:11
stancrm23-May-06 20:11 
AnswerRe: Serial Port Control ,thank you Pin
jackalfb24-May-06 10:44
jackalfb24-May-06 10:44 
Questionado Pin
maryamf23-May-06 12:59
maryamf23-May-06 12:59 
AnswerRe: ado Pin
BoneSoft23-May-06 15:14
BoneSoft23-May-06 15:14 
AnswerRe: ado Pin
MoustafaS23-May-06 15:15
MoustafaS23-May-06 15:15 
AnswerRe: ado [modified] Pin
albCode23-May-06 20:56
albCode23-May-06 20:56 
QuestionActivating child form via right mouse click Pin
marzk23-May-06 12:47
marzk23-May-06 12:47 
QuestionMulti-threading & Listening Sockets Pin
Guinness4Strength23-May-06 12:04
Guinness4Strength23-May-06 12:04 
I have written a Windows Service which creates multiple threads. Each thread listens on a seperate port, writes received messages to disk and acknowledges the receipt of each message. It works perfectly with a single thread so I started load testing multiple threads with disapointing results. I've noticed erratic behavior and am pretty sure its due to the multi-threading. This is my first true multithreaded app and wanted to get some pointers. My Windows Service basically just creates (with ThreadPool.QueueUserWorkItem) and stops the threads as necessary. The rest of the code (Listening and responding, storing port numbers and directory paths, writing messages to disk) is contained in a DLL shared by each thread.
So first question is:
1. Is what I'm attempting to accomplish possible, or is it going to be a locking nightmare ?
The reason I ask is that it appears I need to lock the listening loop since it is contained in a DLL used by each thread. But won't this effectively stop the rest of the the threads from listening to their ports since it is blocking?
Do I need to ditch the idea of listening on multiple ports within threads and just have multiple instances of the same app on a server ?
Any help would be appreciated.


AnswerRe: Multi-threading & Listening Sockets Pin
David Stone23-May-06 13:15
sitebuilderDavid Stone23-May-06 13:15 
Questionhow to write >, <, &to XML file Pin
donkaiser23-May-06 9:26
donkaiser23-May-06 9:26 
AnswerRe: how to write >, <, &to XML file Pin
donkaiser23-May-06 9:33
donkaiser23-May-06 9:33 
GeneralRe: how to write >, <, &to XML file Pin
Robin Panther23-May-06 10:44
Robin Panther23-May-06 10:44 
AnswerRe: how to write >, <, &to XML file Pin
donkaiser23-May-06 10:54
donkaiser23-May-06 10:54 
QuestionException of type 'System.Security.SecurityException' occured Pin
Patricker23-May-06 8:27
Patricker23-May-06 8:27 
AnswerRe: Exception of type 'System.Security.SecurityException' occured Pin
James Gupta23-May-06 9:21
professionalJames Gupta23-May-06 9:21 
GeneralRe: Exception of type 'System.Security.SecurityException' occured Pin
Patricker23-May-06 10:07
Patricker23-May-06 10:07 
GeneralRe: Exception of type 'System.Security.SecurityException' occured Pin
leppie23-May-06 10:15
leppie23-May-06 10:15 
GeneralRe: Exception of type 'System.Security.SecurityException' occured Pin
Patricker23-May-06 10:21
Patricker23-May-06 10:21 
GeneralRe: Exception of type 'System.Security.SecurityException' occured Pin
James Gupta23-May-06 13:29
professionalJames Gupta23-May-06 13:29 
Questionwindows form sizing Pin
reshsilk23-May-06 8:27
reshsilk23-May-06 8:27 
AnswerRe: windows form sizing Pin
James Gupta23-May-06 9:23
professionalJames Gupta23-May-06 9:23 
QuestionUltraCombo in Infragistics Pin
Neel0723-May-06 8:16
Neel0723-May-06 8:16 
Questiona stupid problem about DateTime Pin
da vinci coder23-May-06 7:55
da vinci coder23-May-06 7:55 
AnswerRe: a stupid problem about DateTime Pin
Stefan Troschuetz23-May-06 8:16
Stefan Troschuetz23-May-06 8:16 
GeneralRe: a stupid problem about DateTime Pin
da vinci coder23-May-06 8:57
da vinci coder23-May-06 8:57 

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.