[vlc-devel] [PATCH] Support for Http Dynamic Streaming

Rémi Denis-Courmont remi at remlab.net
Fri May 30 03:54:27 CEST 2014


Le 2014-05-30 02:07, Jonathan Thambidurai a écrit :
> Let us assume that a second thread t2 changes chunk->next.  Since t1
> is storing what it believes to be chunk->next in a register (and not
> updating it from the actual memory location), t1 will get stuck in
> whatever state it was in in the first place.

A thread writing a memory location while another thread is reading the 
same location is explicitly undefined behaviour within the scope of the 
(POSIX and C11) memory model(s). The abuse of the "volatile" keyword 
does not make that any better defined. You are making unwarranted 
assumptions about the implementation of volatile in the compiler, about 
the atomicity and coherence of memory accesses as provided by the 
instructions set and the chipset respectively.

-- 
Rémi Denis-Courmont



More information about the vlc-devel mailing list