two android threads and not synchronized data
Posted
by Sponge
on Stack Overflow
See other posts from Stack Overflow
or by Sponge
Published on 2010-04-06T23:06:59Z
Indexed on
2010/04/06
23:13 UTC
Read the original article
Hit count: 228
i have a (perhaps stupid) question:
im using 2 threads, one is writing floats and one is reading this floats permanently. my question is, what could happen worse when i dont synchronize them? it would be no problem if some of the values would not be correct because they switch just a little every write operation. im running the application this way at the moment and dont have any problems so i want to know what could happen worse?
a read/write conflict would cause a number like 12345 which is written to 54321 and red at the same time appear for example as 54345 ? or could happen something worse? (i dont want to use synchronization to keep the code as fast as possible)
© Stack Overflow or respective owner