Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Programming Threads > Re: volatile an...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 6 Topic 4064 of 4146
Post > Topic >>

Re: volatile and 2 processor

by "Chris M. Thomasson" <no@[EMAIL PROTECTED] > Oct 2, 2008 at 09:12 AM

"Chris Friesen" <cbf123@[EMAIL PROTECTED]
> wrote in message 
news:ZbadnZDLIc7bcnnVnZ2dnUVZ_uydnZ2d@[EMAIL PROTECTED]
> Chris M. Thomasson wrote:
>
>> Sometimes you need volatile for "certain" things in multi-threaded 
>> applications; for instance, the following loop:
>>
>>
>> static atomicword g_running = 1;
>>
>> while (g_running) {
>> }
>>
>>
>> might never terminate if `g_running' was not declared as volatile...
>
> Alternately, you could use locks or barriers and the volatile would not
be 
> necessary.

right.
 




 6 Posts in Topic:
volatile and 2 processor
PasDeSpam@[EMAIL PROTECTE  2008-10-01 20:07:35 
Re: volatile and 2 processor
Chris Friesen <cbf123@  2008-10-01 12:47:20 
Re: volatile and 2 processor
David Schwartz <davids  2008-10-01 22:40:13 
Re: volatile and 2 processor
"Chris M. Thomasson&  2008-10-02 00:47:55 
Re: volatile and 2 processor
Chris Friesen <cbf123@  2008-10-02 09:56:53 
Re: volatile and 2 processor
"Chris M. Thomasson&  2008-10-02 09:12:06 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 9:47:57 CST 2008.