hi mate i have a global date in my class,
this date is used and modified by two thread, i need to solve the problem of mutual exclusion for this date. i m non expert in java, in c is simple, at example:
lock(...)
use/modified global date
unlock(....)
I need the corrispondent in java
There are two approach you can use:
1) Use synchronized keywords:
This is the basics in Java world.
2) In Java 5, there is new set of concurrent library, you can use locks for things you do somehting similar to what you did in C