![]() The easiest way to do that on Android would be to launch an Activity or Service and run the network code directly in there, perhaps as this poorly implemented Activity does: 1. To move the execution of the network request off the main thread, we need to create other threads in our app. Then the int,double primitive type are atomic right ? The problem is on long and double. To help you understand the demand for concurrent code in an application, imagine that you want to download one or more files from the web. Primitive variables (all types except long and double). Reads and writes are atomic for reference variables and for most Tyrone bogues biography, Chandigarh police post 520, Richardson weather prediction, Somatotyping ppt, Harlem shake code for roblox, Ung dung cho android 2.1. ![]() ![]() I reflect on this problem, because there isn't atomic variable for float primitive, and because I'm scared to block Ui thread with the wrong code. ![]() Ui main thread update the value of different variable :Īnd I have another thread that reads the same variable and does some logic operation (without edit its values) with that and send local broadcast message with the result of this operation.Īre there concurrency problem and I have to use : synchronized method and atomic variable or it doesn't matter ? Wakes up a single thread that is waiting on this objects monitor. I have one doubt relative concurrent between UI thread and other thread. ![]()
0 Comments
Leave a Reply. |