Here are three key steps you can take to improve the memory footprint: Limiting the scope of local variables. Each time the top scope from the stack is popped up,…
GeeksNewsLab Posts
Is it better to return NULL or empty values from functions/methods where the return value is not present?
Posted in Education, and WhoCodeFirst
Returning null is usually the best idea if you intend to indicate that no data is available. An empty object implies data has been returned, whereas returning null clearly indicates that nothing has been…
What is a busy spin? Why should you use it?
Posted in Education, and WhoCodeFirst
Busy spin is one of the technique to wait for events without releasing CPU. It’s often done to avoid losing data in CPU cached which is lost if the thread…
One of the practical use of the volatile variable is to make reading double and long atomic. Both double and long are 64-bit wide and they are read in two…
This question is also not easy to answer because volatile is not about atomicity, but there are cases where you can use a volatile variable to make the operation atomic.…