Conviene recordar los posibles usos de volatile, así como para qué no debe usarse:
- How does the C "volatile" keyword really work? de Ian Lance Taylor. El resumen es bastante claro
If you are using volatile for anything other than manipulating memory mapped hardware, or for very limited communication between threads, it is very likely that you are making a mistake. Think carefully about what volatile means and about what it does not mean.
- En la misma linea, Volatile: Almost Useless for Multi-Threaded Programming
- Varias discusiones en usenet: C++, volatile member functions, and threads, volatile guarantees? y Memory Barriers, Compiler Optimizations, etc., todas ellas en comp.programming.threads
- Una discusión sobre lo que es, que no es y que quizás debiera ser volatile en Should volatile Acquire Atomicity and Thread Visibility Semantics?, lo que lleva a arreglar el modelo de memoria de C++.
La vida privada de volatile en barrapunto
No hay comentarios:
Publicar un comentario