Click here to Skip to main content
16,005,281 members
Home / Discussions / C#
   

C#

 
GeneralRe: Share point problem Pin
Simon P Stevens31-Jul-08 0:06
Simon P Stevens31-Jul-08 0:06 
GeneralRe: Share point problem Pin
manju#12331-Jul-08 0:31
manju#12331-Jul-08 0:31 
QuestionRecord Audio from Internet Explorer Pin
Malenko30-Jul-08 23:28
Malenko30-Jul-08 23:28 
QuestionA quick question about volatile Pin
Megidolaon30-Jul-08 23:27
Megidolaon30-Jul-08 23:27 
AnswerRe: A quick question about volatile Pin
Guffa30-Jul-08 23:44
Guffa30-Jul-08 23:44 
AnswerRe: A quick question about volatile Pin
Mike Dimmick31-Jul-08 0:13
Mike Dimmick31-Jul-08 0:13 
AnswerRe: A quick question about volatile Pin
Megidolaon31-Jul-08 1:11
Megidolaon31-Jul-08 1:11 
GeneralRe: A quick question about volatile Pin
Mike Dimmick31-Jul-08 1:32
Mike Dimmick31-Jul-08 1:32 
You must always lock a data structure consistently, before reading as well as writing. Your function DoSomething must lock. A sleep will always be the wrong length and is never, ever the right solution to a race condition. What I mean is, in some circumstances the sleep won't be long enough for the other condition to complete; in others, the operation will complete early and the sleep just wastes time.

Locks only block another thread if the two threads explicitly lock the same data structure.

Megidolaon wrote:
This will produce random output, it seems the threads get different time slices every time I execute the program, how come?


Because thread scheduling depends on the load of all the other things going on in the system. Just moving the mouse slightly differently can have an effect.

If you don't understand locks I would recommend steering well clear of lock-free programming.


DoEvents: Generating unexpected recursion since 1991

GeneralRe: A quick question about volatile Pin
Guffa31-Jul-08 1:37
Guffa31-Jul-08 1:37 
AnswerRe: A quick question about volatile Pin
Megidolaon31-Jul-08 1:59
Megidolaon31-Jul-08 1:59 
QuestionHow to insert a new row to MDB file [modified] Pin
Admin88730-Jul-08 21:53
Admin88730-Jul-08 21:53 
AnswerRe: How to insert a new row to MDB file Pin
leppie30-Jul-08 22:41
leppie30-Jul-08 22:41 
AnswerRe: How to insert a new row to MDB file Pin
rah_sin30-Jul-08 22:42
professionalrah_sin30-Jul-08 22:42 
QuestionSetup with Custom Action Pin
Sifar - 030-Jul-08 21:45
Sifar - 030-Jul-08 21:45 
AnswerRe: Setup with Custom Action Pin
leppie30-Jul-08 22:43
leppie30-Jul-08 22:43 
AnswerRe: Setup with Custom Action Pin
Frank Horn30-Jul-08 23:17
Frank Horn30-Jul-08 23:17 
Questionproblem_details to solve the warning Pin
ktamanna30-Jul-08 21:42
ktamanna30-Jul-08 21:42 
AnswerRe: problem_details to solve the warning Pin
leppie30-Jul-08 22:44
leppie30-Jul-08 22:44 
QuestionHow to resize the form at run time on load Pin
tasumisra30-Jul-08 21:32
tasumisra30-Jul-08 21:32 
AnswerRe: How to resize the form at run time on load Pin
Syed Shahid Hussain30-Jul-08 22:32
Syed Shahid Hussain30-Jul-08 22:32 
GeneralRe: How to resize the form at run time on load Pin
tasumisra30-Jul-08 23:04
tasumisra30-Jul-08 23:04 
GeneralRe: How to resize the form at run time on load Pin
Syed Shahid Hussain31-Jul-08 17:39
Syed Shahid Hussain31-Jul-08 17:39 
GeneralRe: How to resize the form at run time on load Pin
tasumisra31-Jul-08 23:36
tasumisra31-Jul-08 23:36 
GeneralRe: How to resize the form at run time on load Pin
tasumisra31-Jul-08 23:39
tasumisra31-Jul-08 23:39 
GeneralRe: How to resize the form at run time on load Pin
Syed Shahid Hussain1-Aug-08 2:42
Syed Shahid Hussain1-Aug-08 2:42 

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.