posted 13 years ago
Thanks Mark for your valuable input.
Just to check the thread safety of my method i created this :
Its result is below for 3 iterations in the format: "TIME | THREAD NAME | METHOD NAME | LINE NO | logs "
The same method is being called by two threads simultaneously at the same time (loop 0) and as expected for
thread 0 :
|__isUserValid=true
|__getUserExists=1
thread 1:
|__isUserValid=false
|__getUserExists=0
Is that sufficient to check for thread safety of a method?
I mean to say the same method is being called by two threads simultaneously and with different parameters and gets separate result of their own.
Please Check and correct me if i missed something or if I'm wrong on thread safety check.
Thanks & regards
Sushant Verma