Click here to Skip to main content
15,914,162 members
Home / Discussions / C#
   

C#

 
AnswerRe: Dynamically Add Textboxes to datagrid Pin
Stanciu Vlad22-Nov-05 9:08
Stanciu Vlad22-Nov-05 9:08 
QuestionProblem with Mutex in multithreading Application Pin
Alexandr Sergeevich Ilyin22-Nov-05 6:16
Alexandr Sergeevich Ilyin22-Nov-05 6:16 
AnswerRe: Problem with Mutex in multithreading Application Pin
whizzs22-Nov-05 8:57
whizzs22-Nov-05 8:57 
GeneralRe: Problem with Mutex in multithreading Application Pin
Alexandr Sergeevich Ilyin22-Nov-05 17:24
Alexandr Sergeevich Ilyin22-Nov-05 17:24 
GeneralRe: Problem with Mutex in multithreading Application Pin
S. Senthil Kumar22-Nov-05 19:34
S. Senthil Kumar22-Nov-05 19:34 
AnswerRe: Problem with Mutex in multithreading Application Pin
S. Senthil Kumar22-Nov-05 19:36
S. Senthil Kumar22-Nov-05 19:36 
GeneralRe: Problem with Mutex in multithreading Application Pin
Alexandr Sergeevich Ilyin22-Nov-05 19:53
Alexandr Sergeevich Ilyin22-Nov-05 19:53 
AnswerRe: Problem with Mutex in multithreading Application Pin
mcljava29-Nov-05 12:57
mcljava29-Nov-05 12:57 
Take a look at AutoResetEvent or ManualResetEvent as an alternative to using Mutex. Also looking at your code both your threads go into indefinite wait. one solution is: in TF1 delete the mutex.WaitOne statement. Then replace delete the Thread.Sleep(100) line. As the last statement in TF1, add mutex.WaitOne(). This will execute TF1 first, who writes the message, releases the Mutex and then goes into a Wait for state until signaled by TF2. In this way your threads will take turns.

If you need both threads to operate concurrently then you need to add the mutex coordination to the mainline code that started the threads. BTW, you dont need the Thread.Sleep() in TF2 either unless you are just trying to slow down the I/O.

Mike
QuestionHow do i get directx to play a video, without opening a new window? Pin
Anthony Mushrow22-Nov-05 6:01
professionalAnthony Mushrow22-Nov-05 6:01 
AnswerRe: How do i get directx to play a video, without opening a new window? Pin
leppie22-Nov-05 19:00
leppie22-Nov-05 19:00 
QuestionCapture console output Pin
Kash22-Nov-05 5:42
Kash22-Nov-05 5:42 
AnswerRe: Capture console output Pin
S. Senthil Kumar22-Nov-05 5:57
S. Senthil Kumar22-Nov-05 5:57 
GeneralRe: Capture console output Pin
Kash22-Nov-05 23:40
Kash22-Nov-05 23:40 
QuestionHow to playback file wave by tapi Pin
sharapova22-Nov-05 4:51
sharapova22-Nov-05 4:51 
QuestionHash Code calculation Pin
J4amieC22-Nov-05 4:20
J4amieC22-Nov-05 4:20 
AnswerRe: Hash Code calculation Pin
Stanciu Vlad22-Nov-05 6:08
Stanciu Vlad22-Nov-05 6:08 
GeneralRe: Hash Code calculation Pin
J4amieC22-Nov-05 6:23
J4amieC22-Nov-05 6:23 
GeneralRe: Hash Code calculation Pin
Stanciu Vlad22-Nov-05 7:40
Stanciu Vlad22-Nov-05 7:40 
GeneralRe: Hash Code calculation Pin
Leslie Sanford22-Nov-05 9:57
Leslie Sanford22-Nov-05 9:57 
Questionapplication version (major and minor) c# winform Pin
fady_sayegh22-Nov-05 2:34
fady_sayegh22-Nov-05 2:34 
AnswerRe: application version (major and minor) c# winform Pin
Dan Neely22-Nov-05 3:06
Dan Neely22-Nov-05 3:06 
AnswerRe: application version (major and minor) c# winform Pin
J4amieC22-Nov-05 3:17
J4amieC22-Nov-05 3:17 
Question.NET 1.x remoting hell! Pin
Bob Stanneveld22-Nov-05 2:32
Bob Stanneveld22-Nov-05 2:32 
AnswerRe: .NET 1.x remoting hell! Pin
S. Senthil Kumar22-Nov-05 3:56
S. Senthil Kumar22-Nov-05 3:56 
GeneralRe: .NET 1.x remoting hell! Pin
Bob Stanneveld22-Nov-05 22:43
Bob Stanneveld22-Nov-05 22:43 

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.