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

C#

 
GeneralRe: How to make a datagrid with a column of CheckBox????? Pin
welsrping3-Mar-05 13:27
welsrping3-Mar-05 13:27 
GeneralRe: How to make a datagrid with a column of CheckBox????? Pin
Heath Stewart4-Mar-05 6:00
protectorHeath Stewart4-Mar-05 6:00 
GeneralRe: How to make a datagrid with a column of CheckBox????? Pin
welsrping6-Mar-05 12:42
welsrping6-Mar-05 12:42 
AnswerRe: Simple: Make the Table column's Default value to what ever you want. Pin
dlscl4227-Jul-05 23:37
dlscl4227-Jul-05 23:37 
GeneralUnbinding DataSources Pin
Peter Vertes2-Mar-05 14:42
Peter Vertes2-Mar-05 14:42 
GeneralRe: Unbinding DataSources Pin
sreejith ss nair2-Mar-05 18:15
sreejith ss nair2-Mar-05 18:15 
Generalc# multithreading Pin
scottsebelius2-Mar-05 14:04
scottsebelius2-Mar-05 14:04 
GeneralRe: c# multithreading Pin
S. Senthil Kumar2-Mar-05 14:56
S. Senthil Kumar2-Mar-05 14:56 
Your problem is the typical Producer-Consumer problem. One thread writes to the queue and the thread needs to know when the queue is not empty. You can use the AutoResetEvent class or the Monitor class to do the synchronization. Typical code will look like

Class retriever
{
public retrievemsg()
{
while(true)
{
lock(queue)
{
queue.Add(msg);
Monitor.Pulse(queue);
}
}
}
}

class Sender
{
public sendToDB()
{
lock(queue)
{
while(true)
{
Monitor.Wait(queue);
Msg msg = queue.Remove(msg);
}
}
}
}

You can also use the AutoResetEvent to signal the Sender that a message has arrived. The Sender will WaitOne() on the event and once signalled, will fetch the item.


Regards
Senthil
My Blog
GeneralRe: c# multithreading Pin
Dave Kreskowiak3-Mar-05 0:58
mveDave Kreskowiak3-Mar-05 0:58 
QuestionHow to build a dual-action scroll bar ? Pin
paisanousa2-Mar-05 13:31
paisanousa2-Mar-05 13:31 
AnswerRe: How to build a dual-action scroll bar ? Pin
Gamya2-Mar-05 20:01
sussGamya2-Mar-05 20:01 
GeneralRe: How to build a dual-action scroll bar ? Pin
paisanousa3-Mar-05 10:25
paisanousa3-Mar-05 10:25 
GeneralRe: How to build a dual-action scroll bar ? Pin
3-Mar-05 18:39
suss3-Mar-05 18:39 
GeneralRe: How to build a dual-action scroll bar ? Pin
paisanousa4-Mar-05 12:19
paisanousa4-Mar-05 12:19 
AnswerRe: How to build a dual-action scroll bar ? Pin
Gamya3-Mar-05 19:01
sussGamya3-Mar-05 19:01 
GeneralDuring app start, button is repeatedly clicked Pin
porterrific2-Mar-05 13:05
porterrific2-Mar-05 13:05 
GeneralRe: During app start, button is repeatedly clicked Pin
sreejith ss nair2-Mar-05 18:19
sreejith ss nair2-Mar-05 18:19 
GeneralRe: During app start, button is repeatedly clicked Pin
porterrific3-Mar-05 3:44
porterrific3-Mar-05 3:44 
Generaladd,delete,update,serch option ? want code Pin
chandtec2-Mar-05 12:32
chandtec2-Mar-05 12:32 
GeneralRe: add,delete,update,serch option ? want code Pin
Yulianto.2-Mar-05 13:29
Yulianto.2-Mar-05 13:29 
GeneralAccessing Arraylist Collection Pin
MrJJKoolJ2-Mar-05 10:00
MrJJKoolJ2-Mar-05 10:00 
GeneralRe: Accessing Arraylist Collection Pin
TylerBrinks2-Mar-05 10:16
TylerBrinks2-Mar-05 10:16 
Generali dev a proj in c#.net . how to Setup project Pin
chandtec2-Mar-05 9:56
chandtec2-Mar-05 9:56 
GeneralRe: i dev a proj in c#.net . how to Setup project Pin
TylerBrinks2-Mar-05 10:25
TylerBrinks2-Mar-05 10:25 
GeneralConnection Not Closing File.Move Pin
kornstyle2-Mar-05 9:47
kornstyle2-Mar-05 9:47 

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.