Java Reading Notes
Sunday, June 17, 2012
Thursday, March 29, 2012
Wednesday, March 28, 2012
Lock and condition java 5 concurrent api
use synchronized keyword
Object monitorObject;
synchronized(monitorObject){
//critical section
}
new way: use Lock.lock() and Lock.unlock()
Lock lockObject;
try{
lockObject.lock();
}
finally{
lockObject.unlock();
}
----
old way: use wait() and notify() in the critical section
//insdie your critical section
boolean somecondition;
while(somecondition){
wait();
}
boolean someOtherCondition;
if(someOtherCondition){
notify();
}
new way: use await() and signal() on condition variables
Condition conditionVariable = lockObject.newCondition();
boolean somecondition;
while(somecondition){
conitionVariable.await();
}
boolean someothercondition;
if(someOtherCondition){
conditionVariable.signal();
}
Thursday, March 22, 2012
Google question
Tell me what you know about security
What is cursor
Tell me about event system
Dealer inventory, what data structure, if large data,how you display partial while getting the whole
Junit ,what things you need pay attention
Wednesday, March 21, 2012
Subscribe to:
Posts (Atom)