Skip to main content


Showing posts from September, 2012

What is reordering and how does Volatile help?

Following excerpt is from JSR 133 (Java Memory Model) FAQ
What is meant by reordering of instructions? There are a number of cases in which accesses to program variables (object instance fields, class static fields, and array elements) may appear to execute in a different order than was specified by the program. The compiler is free to take liberties with the ordering of instructions in the name of optimization. Processors may execute instructions out of order under certain circumstances. Data may be moved between registers, processor caches, and main memory in different order than specified by the program.
For example, if a thread writes to field a and then to field b, and the value of b does not depend on the value of a, then the compiler is free to reorder these operations, and the cache is free to flush b to main memory before a. There are a number of potential sources of reordering, such as the compiler, the JIT, and the cache.
The compiler, runtime, and hardware are supposed to…

How to check individual cookies in IE, Firefox and Chrome

How often has this happened with you that you visited a site and after that which ever site you went to, you started seeing the ads of the site you visited?

If you know anything about web and browsers you know it is the cookies that were planted by the site. Cookies are nothing but small text files containing some information about the client machine. Often harmless and mostly used by sites to give you a tailor-made experience whenever you visit the site next, but very annoying in some cases like the one I just mentioned.

Browsers give you facility to clear either the entire browsing history (which includes visited sites, cookies, cache, form data etc.) or individual items and you can delete all the cookies in one go. But if you want to see which sites have planted cookies in your machine and clear only the ones you want to, read on.

Chrome:  Click on the 'Wrench Menu'.
Click on 'Show Advanced Settings'.
Under 'Privacy', click on 'Content Settings' but…