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

C#

 
GeneralRe: escape sequences in C# Pin
lawrenceinba13-Jan-09 0:51
lawrenceinba13-Jan-09 0:51 
GeneralRe: escape sequences in C# Pin
Guffa13-Jan-09 0:53
Guffa13-Jan-09 0:53 
GeneralRe: escape sequences in C# Pin
S. Senthil Kumar13-Jan-09 0:56
S. Senthil Kumar13-Jan-09 0:56 
GeneralThreads and random() Pin
gudrunkr13-Jan-09 0:01
gudrunkr13-Jan-09 0:01 
GeneralRe: Threads and random() Pin
SeMartens13-Jan-09 0:06
SeMartens13-Jan-09 0:06 
GeneralRe: Threads and random() Pin
gudrunkr13-Jan-09 0:13
gudrunkr13-Jan-09 0:13 
GeneralRe: Threads and random() Pin
SeMartens13-Jan-09 0:15
SeMartens13-Jan-09 0:15 
GeneralRe: Threads and random() Pin
S. Senthil Kumar13-Jan-09 1:04
S. Senthil Kumar13-Jan-09 1:04 
Do you know why it didn't work first?

The Random class uses the current time as the "seed" for generating random numbers. Because you created two instances, one for each thread, and the two threads started running in parallel right away, both of them got the same seed and therefore generated the same sequence of random numbers.

BTW, the MSDN doc says that instance methods on the Random class are not thread safe - you might have to look out for that.

Regards
Senthil [MVP - Visual C#]
_____________________________
My Home Page |My Blog | My Articles | My Flickr | WinMacro

QuestionQuestion on SqlDataReader[string name] Pin
Dewald12-Jan-09 23:08
Dewald12-Jan-09 23:08 
AnswerRe: Question on SqlDataReader[string name] Pin
SeMartens12-Jan-09 23:14
SeMartens12-Jan-09 23:14 
AnswerRe: Question on SqlDataReader[string name] Pin
Wendelius12-Jan-09 23:35
mentorWendelius12-Jan-09 23:35 
GeneralRe: Question on SqlDataReader[string name] Pin
Dewald12-Jan-09 23:55
Dewald12-Jan-09 23:55 
GeneralRe: Question on SqlDataReader[string name] Pin
Wendelius13-Jan-09 0:02
mentorWendelius13-Jan-09 0:02 
Questionsaving image in image folder using c# Pin
sandhya1412-Jan-09 23:00
sandhya1412-Jan-09 23:00 
AnswerRe: saving image in image folder using c# Pin
musefan12-Jan-09 23:06
musefan12-Jan-09 23:06 
GeneralRe: saving image in image folder using c# Pin
sandhya1414-Jan-09 18:11
sandhya1414-Jan-09 18:11 
GeneralRe: saving image in image folder using c# Pin
musefan14-Jan-09 22:13
musefan14-Jan-09 22:13 
GeneralRe: saving image in image folder using c# Pin
sandhya1415-Jan-09 0:34
sandhya1415-Jan-09 0:34 
GeneralRe: saving image in image folder using c# Pin
musefan15-Jan-09 0:44
musefan15-Jan-09 0:44 
GeneralRe: saving image in image folder using c# Pin
sandhya1415-Jan-09 17:36
sandhya1415-Jan-09 17:36 
QuestionCatching Line-out signal in C# Pin
Maquis.12-Jan-09 22:08
Maquis.12-Jan-09 22:08 
QuestionInstaller components in C# Pin
adi.rusu12-Jan-09 21:59
adi.rusu12-Jan-09 21:59 
AnswerRe: Installer components in C# Pin
rohan_puranik12-Jan-09 23:25
rohan_puranik12-Jan-09 23:25 
GeneralRe: Installer components in C# Pin
adi.rusu13-Jan-09 0:29
adi.rusu13-Jan-09 0:29 
QuestionHow to rotate a form in c#, or maybe just the controlls? Pin
maclinux12-Jan-09 21:09
maclinux12-Jan-09 21:09 

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.