[lkml]   [2003]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectvolatile variable

If a system call is having following code.

add current process into wait quque ;
while (1)
{ set task state INTERRUPTIBLE ;
if (a > 0)
break ;
schedule() ;
set task state RUNNING ;
remove current from wait queue ;

If an interrupt service is having following code

set a = 512 ;

'a' is a global variable shared in ISR and system call

Do I need to define a as 'volatile int a ;' ? Why?

Thanks & Regards,

Download the hottest & happening ringtones here!
OR SMS: Top tone to 7333
Click here now:

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:47    [W:0.107 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site