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

C#

 
GeneralRe: Timer Pin
rahultaing12-Apr-06 21:05
rahultaing12-Apr-06 21:05 
AnswerRe: Timer Pin
rahultaing12-Apr-06 21:06
rahultaing12-Apr-06 21:06 
AnswerRe: Timer Pin
Corinna John12-Apr-06 21:07
Corinna John12-Apr-06 21:07 
AnswerRe: Timer Pin
V.12-Apr-06 21:19
professionalV.12-Apr-06 21:19 
Questionvideo player in c# Pin
ramyasangeet12-Apr-06 20:22
ramyasangeet12-Apr-06 20:22 
QuestionHelp regarding IKVMC tool Pin
sathyasivam12-Apr-06 20:03
sathyasivam12-Apr-06 20:03 
QuestionThread Synchronization program Pin
eric_tran12-Apr-06 19:42
eric_tran12-Apr-06 19:42 
AnswerRe: Thread Synchronization program Pin
Tehnoon12-Apr-06 20:02
Tehnoon12-Apr-06 20:02 
Lots of problems in here.

1. Why are you using lock(lockObject), when lockObject is not being modified or even used by any thread at all!!! If you want to allow one thread at a time to modify your Array List, you should use lock(list).

2. In the code:
int x = rand.Next(1, list.Count);
list.Remove(x);

You are assuming that x is always present in the list. Whereas it is a possibility that x might have been removed by any other thread. Instead of removing the actual entry, you should use the indexes by using RemoveAt, and the number should not be x, it should be list[x].

3. The code written in the function will only execute five times, once per thread. So the list of 1000 will not get exhausted with this. You should use a loop to iterate through the list.


GeneralRe: Thread Synchronization program Pin
eric_tran12-Apr-06 20:51
eric_tran12-Apr-06 20:51 
GeneralRe: Thread Synchronization program Pin
eric_tran12-Apr-06 20:55
eric_tran12-Apr-06 20:55 
QuestionHow to reach the (Name) property Pin
Calin Macrinici12-Apr-06 18:13
Calin Macrinici12-Apr-06 18:13 
AnswerRe: How to reach the (Name) property Pin
Tehnoon12-Apr-06 19:40
Tehnoon12-Apr-06 19:40 
GeneralRe: How to reach the (Name) property Pin
Calin Macrinici13-Apr-06 3:41
Calin Macrinici13-Apr-06 3:41 
QuestionHow to change column width in crystalreport Pin
LongNguyen12-Apr-06 17:46
LongNguyen12-Apr-06 17:46 
AnswerRe: How to change column width in crystalreport Pin
vamsimohan2112-Apr-06 17:56
vamsimohan2112-Apr-06 17:56 
QuestionFlickering on derived button with transparancy Pin
techt12-Apr-06 14:39
techt12-Apr-06 14:39 
AnswerRe: Flickering on derived button with transparancy Pin
alexey N12-Apr-06 18:46
alexey N12-Apr-06 18:46 
QuestionTreeList View Items Pin
ang2612-Apr-06 14:14
ang2612-Apr-06 14:14 
Questioncrystal report problem Pin
shabonaa12-Apr-06 11:52
shabonaa12-Apr-06 11:52 
AnswerRe: crystal report problem Pin
vamsimohan2112-Apr-06 17:49
vamsimohan2112-Apr-06 17:49 
GeneralRe: crystal report problem Pin
shabonaa12-Apr-06 21:14
shabonaa12-Apr-06 21:14 
Questionstrange exception caused by DirectX? Pin
melanieab12-Apr-06 10:30
melanieab12-Apr-06 10:30 
AnswerRe: strange exception caused by DirectX? Pin
Judah Gabriel Himango12-Apr-06 10:59
sponsorJudah Gabriel Himango12-Apr-06 10:59 
AnswerRe: strange exception caused by DirectX? Pin
mav.northwind12-Apr-06 20:02
mav.northwind12-Apr-06 20:02 
GeneralRe: strange exception caused by DirectX? Pin
melanieab13-Apr-06 4:27
melanieab13-Apr-06 4:27 

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.