Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralArrayLists & multithreading... Pin
viperxp15-Jun-03 5:56
viperxp15-Jun-03 5:56 
GeneralRe: ArrayLists & multithreading... Pin
leppie15-Jun-03 6:44
leppie15-Jun-03 6:44 
GeneralRe: ArrayLists & multithreading... Pin
Arjan Einbu15-Jun-03 11:46
Arjan Einbu15-Jun-03 11:46 
GeneralRe: ArrayLists & multithreading... Pin
viperxp15-Jun-03 23:24
viperxp15-Jun-03 23:24 
GeneralRe: ArrayLists & multithreading... Pin
James T. Johnson16-Jun-03 0:10
James T. Johnson16-Jun-03 0:10 
GeneralRe: ArrayLists & multithreading... Pin
viperxp16-Jun-03 2:53
viperxp16-Jun-03 2:53 
GeneralRe: ArrayLists & multithreading... Pin
James T. Johnson16-Jun-03 3:13
James T. Johnson16-Jun-03 3:13 
GeneralRe: ArrayLists & multithreading... Pin
viperxp16-Jun-03 7:10
viperxp16-Jun-03 7:10 
First of all,

Thanks for prompt reply.

James T. Johnson wrote:
With Synchronized() you don't have to do anything but ensure that you do all of your reading and writing with syncList.

Are u saying that whenever I need to access (be it read / write) theList, I just get the enclose the code block in a lock(syncList.SyncRoot), no matter where the read / write operation lies... in my case, they are in different classes.

From what u wrote, it seems that i dont have to do any checks, i.e. is there any other threads accessing tthe list or not etc b4 commencing my "I/O" operations... is my interpretation correct?

can i put it in this way....

syncList.SyncRoot provides a "safe" reference to theList. whenever any code within lock(syncList.SyncRoot) is running, all other code accessing theList - most probably thru the syncList.SyncRoot reference, regardless of whether it's in a lock() block or not, will have to wait till the "active" lock() block completes?

how about deadlock and "starvation" problems...? e.g. when a thread terminated prematurely, will the lock be released? if not, wut can i do prevent this prob?

Thanks again, yur replies helps a great deal Wink | ;)
QuestionSimple inheritance? Pin
mcgahanfl15-Jun-03 2:27
mcgahanfl15-Jun-03 2:27 
AnswerRe: Simple inheritance? Pin
leppie15-Jun-03 3:54
leppie15-Jun-03 3:54 
GeneralRe: Simple inheritance? Pin
mcgahanfl15-Jun-03 17:14
mcgahanfl15-Jun-03 17:14 
GeneralWeb service performance... Pin
Matt Gullett15-Jun-03 2:25
Matt Gullett15-Jun-03 2:25 
GeneralRe: Web service performance... Pin
Kannan Kalyanaraman15-Jun-03 3:41
Kannan Kalyanaraman15-Jun-03 3:41 
GeneralRe: Web service performance... Pin
Matt Gullett15-Jun-03 3:47
Matt Gullett15-Jun-03 3:47 
GeneralRe: Web service performance... Pin
Kannan Kalyanaraman15-Jun-03 17:01
Kannan Kalyanaraman15-Jun-03 17:01 
GeneralRe: Web service performance... Pin
Rocky Moore15-Jun-03 23:18
Rocky Moore15-Jun-03 23:18 
GeneralRe: Web service performance... Pin
Matt Gullett15-Jun-03 23:35
Matt Gullett15-Jun-03 23:35 
GeneralDynamic object cloneing. Pin
Peter Kiss15-Jun-03 1:07
Peter Kiss15-Jun-03 1:07 
GeneralC# Service won't start Pin
gek_at14-Jun-03 23:59
gek_at14-Jun-03 23:59 
GeneralRe: C# Service won't start Pin
mcgahanfl15-Jun-03 2:16
mcgahanfl15-Jun-03 2:16 
GeneralRe: C# Service won't start Pin
gek_at15-Jun-03 3:20
gek_at15-Jun-03 3:20 
GeneralRe: C# Service won't start Pin
mcgahanfl15-Jun-03 3:53
mcgahanfl15-Jun-03 3:53 
GeneralRe: C# Service won't start Pin
gek_at15-Jun-03 11:11
gek_at15-Jun-03 11:11 
GeneralRe: C# Service won't start Pin
gek_at16-Jun-03 7:31
gek_at16-Jun-03 7:31 
QuestionHow to connect to SQL Server running on one remote Server. Pin
Ken Zhu14-Jun-03 18:40
Ken Zhu14-Jun-03 18:40 

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.