Click here to Skip to main content
15,893,487 members
Home / Discussions / C#
   

C#

 
QuestionC# Coding Pin
jonhbt6-Aug-08 21:52
jonhbt6-Aug-08 21:52 
AnswerRe: C# Coding Pin
Rob Philpott6-Aug-08 22:18
Rob Philpott6-Aug-08 22:18 
AnswerRe: C# Coding Pin
jonhbt6-Aug-08 22:33
jonhbt6-Aug-08 22:33 
GeneralRe: C# Coding Pin
Rob Philpott7-Aug-08 1:23
Rob Philpott7-Aug-08 1:23 
AnswerRe: C# Coding Pin
blackjack21506-Aug-08 22:28
blackjack21506-Aug-08 22:28 
AnswerRe: C# Coding Pin
Thomas Stockwell7-Aug-08 1:31
professionalThomas Stockwell7-Aug-08 1:31 
QuestionSSL samples and ServerCertificateValidationCallback Pin
George_George6-Aug-08 21:38
George_George6-Aug-08 21:38 
AnswerRe: SSL samples and ServerCertificateValidationCallback Pin
leppie7-Aug-08 2:57
leppie7-Aug-08 2:57 
GeneralRe: SSL samples and ServerCertificateValidationCallback Pin
George_George9-Aug-08 0:03
George_George9-Aug-08 0:03 
Questionrating of an artilcle in c# Pin
r aa j6-Aug-08 21:34
r aa j6-Aug-08 21:34 
AnswerRe: rating of an artilcle in c# Pin
Colin Angus Mackay6-Aug-08 23:07
Colin Angus Mackay6-Aug-08 23:07 
AnswerRe: rating of an artilcle in c# Pin
Manas Bhardwaj7-Aug-08 5:25
professionalManas Bhardwaj7-Aug-08 5:25 
GeneralGreat,,,,,,,,,,,,,, Pin
r aa j7-Aug-08 18:29
r aa j7-Aug-08 18:29 
Questioncheck for updates Button Pin
laziale6-Aug-08 20:33
laziale6-Aug-08 20:33 
AnswerRe: check for updates Button Pin
Programm3r6-Aug-08 20:45
Programm3r6-Aug-08 20:45 
QuestionThread Question Pin
Programm3r6-Aug-08 20:28
Programm3r6-Aug-08 20:28 
AnswerRe: Thread Question Pin
MarkB7776-Aug-08 21:19
MarkB7776-Aug-08 21:19 
QuestionRe: Thread Question Pin
Programm3r6-Aug-08 21:52
Programm3r6-Aug-08 21:52 
AnswerRe: Thread Question Pin
GeorgeBerry7-Aug-08 0:43
GeorgeBerry7-Aug-08 0:43 
AnswerRe: Thread Question Pin
MarkB7776-Aug-08 23:36
MarkB7776-Aug-08 23:36 
Hi,

Programm3r wrote:
I want to create two threads and declare an enumeration to store some thread states (not referring to ThreadState). I.E:


No this is not a good approach, as it is not promoting code reuse.

Programm3r wrote:
When the one thread wants to do some processing, it first check the state of the other thread before proceeding. Should the state be in threadSleeping state the one thread puts the other one in a Suspend state and can continue processing, thus the following can be prevented:

A thread may be performing a system-wide-synchronized operation like locking a range of bytes in a file, writing to those bytes, unlocking those bytes, then closing the file. A thread is suspended before the unlock, that range of bytes will remain locked for an indeterminate amount of time until the thread is resumed or the process terminates


If I've read correctly your process is fine. The usual approach when dealing with two threads that are sharing one resource is to use a mutex semaphore to block one thread while the other is doing some work.

I believe that .NET has classes (Mutex, Semaphore) in System.Threading that support this.


I hope this helps,


Cheers,


QuestionThe .Net C# Give Me the Exeption For Serialisation Pin
Thaer Hamael6-Aug-08 19:53
Thaer Hamael6-Aug-08 19:53 
AnswerRe: The .Net C# Give Me the Exeption For Serialisation Pin
stancrm6-Aug-08 20:17
stancrm6-Aug-08 20:17 
GeneralRe: The .Net C# Give Me the Exeption For Serialisation Pin
Thaer Hamael6-Aug-08 20:24
Thaer Hamael6-Aug-08 20:24 
GeneralRe: The .Net C# Give Me the Exeption For Serialisation Pin
Thaer Hamael6-Aug-08 20:24
Thaer Hamael6-Aug-08 20:24 
GeneralRe: The .Net C# Give Me the Exeption For Serialisation Pin
leppie6-Aug-08 22:33
leppie6-Aug-08 22:33 

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.