global variables - threadlocal
Posted on 2013-01-21
<<If you are porting a single-threaded application to multithreaded environment, you can preserve thread safety by converting shared global variables into ThreadLocals.
Lines taken from book
Brian Goetz, Java concurrency in practise, page 46.
Can anyone please explain with an example how this works.