Click here to Skip to main content
15,891,253 members
Home / Discussions / C#
   

C#

 
GeneralDelimiters While Reading Text Files Pin
Anonymous1-Feb-05 13:35
Anonymous1-Feb-05 13:35 
GeneralRe: Delimiters While Reading Text Files Pin
Robert Rohde1-Feb-05 20:35
Robert Rohde1-Feb-05 20:35 
GeneralRe: Delimiters While Reading Text Files Pin
spif20011-Feb-05 20:42
spif20011-Feb-05 20:42 
GeneralRe: Delimiters While Reading Text Files Pin
Anonymous2-Feb-05 4:21
Anonymous2-Feb-05 4:21 
GeneralRe: Delimiters While Reading Text Files Pin
Dave Kreskowiak2-Feb-05 4:35
mveDave Kreskowiak2-Feb-05 4:35 
GeneralRe: Delimiters While Reading Text Files Pin
Sean Michael Murphy2-Feb-05 6:48
Sean Michael Murphy2-Feb-05 6:48 
GeneralRe: Delimiters While Reading Text Files Pin
Anonymous2-Feb-05 10:11
Anonymous2-Feb-05 10:11 
QuestionHow do i use lock(List.SyncRoot) properly in a collection? Pin
FocusedWolf1-Feb-05 13:17
FocusedWolf1-Feb-05 13:17 
Ok, situation as such...have a collection and it extends collectionbase.

this is how all of my functions go, in their most simple form...all code in (welcoming?) arms of a lock with the intention of making my control threadsafe.

public void Add(string text)
{
lock(List.SyncRoot)
{
List.Add(new SimpleListItem(text));
}
}

When i start adding items to the control with both a thread, and at same time syncheroussly...the control freezes up.

I think at that point its stuck in some kind of race condition because conflicting locks are preventing anything from getting into the collection for infinity and beyond :P

This leads me to my question:

Where do i put lock(List.SyncRoot)? When i comment out that line from my add function the control goes fine...
AnswerRe: How do i use lock(List.SyncRoot) properly in a collection? Pin
Robert Rohde1-Feb-05 20:38
Robert Rohde1-Feb-05 20:38 
GeneralRe: How do i use lock(List.SyncRoot) properly in a collection? Pin
Anonymous2-Feb-05 3:03
Anonymous2-Feb-05 3:03 
QuestionLogon/Logout Methods? Pin
spacebass50001-Feb-05 13:15
spacebass50001-Feb-05 13:15 
AnswerRe: Logon/Logout Methods? Pin
Dave Kreskowiak2-Feb-05 1:55
mveDave Kreskowiak2-Feb-05 1:55 
GeneralRe: Logon/Logout Methods? Pin
spacebass50002-Feb-05 2:20
spacebass50002-Feb-05 2:20 
GeneralRe: Logon/Logout Methods? Pin
spacebass50002-Feb-05 3:41
spacebass50002-Feb-05 3:41 
GeneralRe: Logon/Logout Methods? Pin
Dave Kreskowiak2-Feb-05 4:34
mveDave Kreskowiak2-Feb-05 4:34 
GeneralRe: Logon/Logout Methods? Pin
spacebass50002-Feb-05 5:10
spacebass50002-Feb-05 5:10 
GeneralText Editing Pin
dcrewes1-Feb-05 12:02
dcrewes1-Feb-05 12:02 
GeneralRe: Text Editing Pin
Christian Graus1-Feb-05 17:04
protectorChristian Graus1-Feb-05 17:04 
GeneralRe: Text Editing Pin
Robert Rohde1-Feb-05 20:46
Robert Rohde1-Feb-05 20:46 
GeneralDisplay a presentation on TV Pin
SquallBlade1-Feb-05 11:38
SquallBlade1-Feb-05 11:38 
GeneralRe: Display a presentation on TV Pin
Christian Graus1-Feb-05 17:06
protectorChristian Graus1-Feb-05 17:06 
GeneralRe: Display a presentation on TV Pin
SquallBlade1-Feb-05 21:53
SquallBlade1-Feb-05 21:53 
GeneralRe: Display a presentation on TV Pin
Dave Kreskowiak2-Feb-05 1:51
mveDave Kreskowiak2-Feb-05 1:51 
GeneralRe: Display a presentation on TV Pin
SquallBlade2-Feb-05 3:52
SquallBlade2-Feb-05 3:52 
GeneralRe: Display a presentation on TV Pin
Heath Stewart2-Feb-05 6:34
protectorHeath Stewart2-Feb-05 6:34 

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.