A
A
Alexander2015-02-16 17:39:48
Java
Alexander, 2015-02-16 17:39:48

Andoid synchronized, volatile is it necessary?

The application uses a class that stores all the data that is taken from the network. For almost every action, we go to the Internet through AsyncTask, parse the response and put it into this class. Naturally, since each request to the server goes in a separate thread and then saves this data, the next one running on a different core can see the old data. Am I right or does AsyncTask solve this problem somehow?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily, 2015-02-16
Obiedkov @aobiedkov

0_o How can AsyncTask affect the behavior of your class at all?
In any case, you should always build the correct architecture of your application, including keeping track of the race condition.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question