Click here to Skip to main content
15,900,378 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to create sub forms in C#.net? Pin
Christian Graus23-Jan-07 8:51
protectorChristian Graus23-Jan-07 8:51 
Questionconnected components analysis Pin
alainrc200522-Jan-07 10:43
alainrc200522-Jan-07 10:43 
QuestionLarge sitemap loading slowly.... any tricks to speed things up Pin
lsugirljte22-Jan-07 10:33
lsugirljte22-Jan-07 10:33 
Questionrepaint Pin
samreengr822-Jan-07 10:17
samreengr822-Jan-07 10:17 
AnswerRe: repaint Pin
mdzieg22-Jan-07 10:30
mdzieg22-Jan-07 10:30 
QuestionWhirlpool in .NET Pin
JungoMungo22-Jan-07 10:07
JungoMungo22-Jan-07 10:07 
AnswerRe: Whirlpool in .NET Pin
Dave Kreskowiak22-Jan-07 10:13
mveDave Kreskowiak22-Jan-07 10:13 
Questionmultithreading Pin
vbar22-Jan-07 9:38
vbar22-Jan-07 9:38 
hi,

i have a problem concerning thread syncing with a manualresetevent. my code looks as below:

//this is a part of the callback of a receiving thread, qpt never gets null
//messageReceived is a manualresetevent
string qpt = myString.Substring(0, index);
Queue.Synchronized(this.Messages).Enqueue(qpt);
messageReceived.Set();

//and this is the code of my main thread, waiting for messages arriving in the queue
if (Queue.Synchronized(this.Messages).Count <= 0)
messageReceived.WaitOne(); //really waits (commented the .set)

Monitor.Enter(this.Messages);

string curLine = (string)(Queue.Synchronized(this.Messages).Dequeue());
messageReceived.Reset();

Monitor.Exit(this.Messages);

//...doing something with curline

when dequeuing, the element count is still 0. why? the queue isnt used anywhere else and it works with
while(true){
if (Queue.Synchronized(this.Messages).Count > 0)break;
}
instead of waitone (but takes 100%)
it seems that it takes a while until the queue recognises its new elements (does work with waitone if i place a debug point at waitone and always press play...). i also tried different combinations of monitor.enter, Queue.Synchronized with same results.

any ideas?
AnswerRe: multithreading Pin
Judah Gabriel Himango22-Jan-07 12:10
sponsorJudah Gabriel Himango22-Jan-07 12:10 
GeneralRe: multithreading Pin
Luc Pattyn22-Jan-07 14:38
sitebuilderLuc Pattyn22-Jan-07 14:38 
GeneralRe: multithreading Pin
vbar23-Jan-07 5:29
vbar23-Jan-07 5:29 
GeneralRe: multithreading Pin
Luc Pattyn23-Jan-07 6:07
sitebuilderLuc Pattyn23-Jan-07 6:07 
GeneralRe: multithreading [modified] Pin
vbar23-Jan-07 8:03
vbar23-Jan-07 8:03 
QuestionConfiguration files Pin
peshawarcoder22-Jan-07 9:36
peshawarcoder22-Jan-07 9:36 
AnswerRe: Configuration files Pin
Rick van Woudenberg22-Jan-07 9:45
Rick van Woudenberg22-Jan-07 9:45 
AnswerRe: Configuration files Pin
Dave Kreskowiak22-Jan-07 10:09
mveDave Kreskowiak22-Jan-07 10:09 
GeneralRe: Configuration files Pin
peshawarcoder23-Jan-07 4:27
peshawarcoder23-Jan-07 4:27 
GeneralRe: Configuration files Pin
Dave Kreskowiak23-Jan-07 12:32
mveDave Kreskowiak23-Jan-07 12:32 
QuestionSoapExtensionAttribute at the client proxy side Pin
Walter Dias22-Jan-07 8:55
professionalWalter Dias22-Jan-07 8:55 
Questionhide a file Pin
nima_dir22-Jan-07 7:24
nima_dir22-Jan-07 7:24 
AnswerRe: hide a file Pin
aamironline24-Jan-07 15:33
aamironline24-Jan-07 15:33 
QuestionDecimal roundoff problem Pin
Rick van Woudenberg22-Jan-07 7:15
Rick van Woudenberg22-Jan-07 7:15 
AnswerRe: Decimal roundoff problem Pin
Stefan Troschuetz22-Jan-07 7:24
Stefan Troschuetz22-Jan-07 7:24 
AnswerRe: Decimal roundoff problem Pin
PIEBALDconsult22-Jan-07 7:29
mvePIEBALDconsult22-Jan-07 7:29 
AnswerRe: Decimal roundoff problem (solved) Pin
Rick van Woudenberg22-Jan-07 8:22
Rick van Woudenberg22-Jan-07 8:22 

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.