Click here to Skip to main content
15,895,462 members
Home / Discussions / C#
   

C#

 
QuestionMaking Project Pin
Sameh96140335-Nov-07 11:30
Sameh96140335-Nov-07 11:30 
AnswerRe: Making Project Pin
Paul Conrad5-Nov-07 15:25
professionalPaul Conrad5-Nov-07 15:25 
QuestionData not stored on pocket pc Pin
karanjsingh5-Nov-07 11:19
karanjsingh5-Nov-07 11:19 
QuestionThreadsafe "for" without lock() Pin
szolDat5-Nov-07 11:05
szolDat5-Nov-07 11:05 
AnswerRe: Threadsafe "for" without lock() Pin
Guffa5-Nov-07 12:07
Guffa5-Nov-07 12:07 
AnswerRe: Threadsafe "for" without lock() Pin
szolDat5-Nov-07 12:31
szolDat5-Nov-07 12:31 
GeneralRe: Threadsafe "for" without lock() Pin
PIEBALDconsult5-Nov-07 16:02
mvePIEBALDconsult5-Nov-07 16:02 
AnswerRe: Threadsafe "for" without lock() Pin
Guffa5-Nov-07 20:24
Guffa5-Nov-07 20:24 
szolDat wrote:
Please explain why the following situation isn't possible (I'm somewhat clear about the heap and the stack):
Thread1 enters the cycle, increments i by 1.
The control is passed to Thread2 and it enters the cycle too, incrementing i by 1. i now equals 2.
Thread1 gets control again and tries to access an array's element (or perform any action) using the cycle variable.


Every time that you enter a method, a stack frame is created for the local variables in the method. That stack frame is unique for that single method call, so that method call has it's own set of local varables that isn't shared by anything else anywhere.

Even if the method call's itself (recursion) so that the method call is in the same thread and has the same stack, another stack frame is created, and the local variables in that call are separate from the local variables in the previous call.

If the method calls occur in separate threads, each call will have it's own stack frame, but now they are even in separate stacks.

Experience is the sum of all the mistakes you have done.

GeneralRe: Threadsafe "for" without lock() Pin
szolDat6-Nov-07 21:38
szolDat6-Nov-07 21:38 
AnswerRe: Threadsafe "for" without lock() Pin
Guffa6-Nov-07 22:20
Guffa6-Nov-07 22:20 
Questionunknown problem is visual studio Pin
netJP12L5-Nov-07 10:38
netJP12L5-Nov-07 10:38 
AnswerRe: unknown problem is visual studio Pin
Colin Angus Mackay5-Nov-07 11:00
Colin Angus Mackay5-Nov-07 11:00 
GeneralRe: unknown problem is visual studio Pin
netJP12L6-Nov-07 3:56
netJP12L6-Nov-07 3:56 
GeneralRe: EventArgs Pin
half-life5-Nov-07 10:34
half-life5-Nov-07 10:34 
QuestionHash Encryption Pin
Eli Nurman5-Nov-07 9:15
Eli Nurman5-Nov-07 9:15 
AnswerRe: Hash Encryption Pin
led mike5-Nov-07 9:22
led mike5-Nov-07 9:22 
GeneralRe: Hash Encryption Pin
Anthony Mushrow5-Nov-07 12:25
professionalAnthony Mushrow5-Nov-07 12:25 
AnswerRe: Hash Encryption Pin
dino20945-Nov-07 9:42
dino20945-Nov-07 9:42 
QuestionTouchScreen And Mouse separate. [modified] Pin
anselmo5-Nov-07 9:06
anselmo5-Nov-07 9:06 
QuestionQuery based on GUID in Access DB Pin
Christian Graus5-Nov-07 8:58
protectorChristian Graus5-Nov-07 8:58 
AnswerRe: Query based on GUID in Access DB Pin
pmarfleet5-Nov-07 9:51
pmarfleet5-Nov-07 9:51 
GeneralRe: Query based on GUID in Access DB [modified] Pin
Christian Graus5-Nov-07 9:59
protectorChristian Graus5-Nov-07 9:59 
GeneralRe: Query based on GUID in Access DB Pin
pmarfleet5-Nov-07 10:16
pmarfleet5-Nov-07 10:16 
GeneralRe: Query based on GUID in Access DB Pin
Christian Graus5-Nov-07 10:31
protectorChristian Graus5-Nov-07 10:31 
AnswerRe: Query based on GUID in Access DB Pin
PIEBALDconsult5-Nov-07 16:10
mvePIEBALDconsult5-Nov-07 16:10 

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.