Why use volatile for socket state?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

Why do we need the socket state (for the nework layer representation of the sockets) to be 
 volatile? 
It is implemented as volatile unsigned  char skc_state in struct sock_common .

The tcp state change handler does not give me any clues also.

Is this simply an overkill here or to supress optimization from the GCC?

Can we just use memory barriers here?[refer: volatile considered harmful on LKML]

Thank you
~psr

--
play the game

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux