Thread synchronization with in the same address space

teclis High Elf <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <CAN4o2gMEB3jQG=2vnGDwqDAZ6B+Lf+-bZ=JzofAhemD8uE+nvg@mail.gmail.com>
I have two threads running in the same server. On thread handles incoming
ipc messages from the clients in different address spaces and the other
thread does the work. The thread handling the incoming ipc needs to pass an
integer value to the worker thread. Could I synchronize them using

int l4util_cmpxchg32
<https://os.inf.tu-dresden.de/L4Re/doc/group__l4util__atomic.html#gacb4a5e47fea67cc4c61b488fc374df62>
(volatile l4_uint32_t
<https://os.inf.tu-dresden.de/L4Re/doc/group__l4__basic__types.html#gac1d09f3e382e711b776931f10e6e1e5a>
*dest, l4_uint32_t
<https://os.inf.tu-dresden.de/L4Re/doc/group__l4__basic__types.html#gac1d09f3e382e711b776931f10e6e1e5a>
cmp_val, l4_uint32_t
<https://os.inf.tu-dresden.de/L4Re/doc/group__l4__basic__types.html#gac1d09f3e382e711b776931f10e6e1e5a>
new_val)

the worker thread could then check the value of dest to get the integer.
Would the worker thread need to use an atomic read function when it reads
the value of dest and if so which function would the worker thread use for
the atomic read?

thanks,

_______________________________________________
l4-hackers mailing list
[email protected]
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.