Why socket state is volatile?

[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 it just to supress optimization from the GCC?

Is some other thread capable of changing it, apart from the usual
state_changed handler ?

Am i missing something here?

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

Thank you
~psr
--
play the game
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux