volatile in struct

Sergei Organov osv at topconrd.ru
Mon Feb 16 18:44:12 UTC 2004


Juergen Zeller <juergen.zeller at argovision.de> writes:
> Hello all,
> 
> I'm confused, I need help from the specialists!

1. You should protect your shared data with *the same* primitive in all the
   threads. Either use rtems_interrupt_x in both threads or use
   rtems_semaphore_x in both threads.

2. Using volatile is almost never a good idea. If you use RTOS primitives for
   mutual exclusion correctly, you don't need volatile for your protected
   data.

-- 
Sergei.





More information about the users mailing list