multithreading - Java profiling for scalability and time complexity -
i working on java application has producer-consumer pattern. earlier producer not producing events in order (for example '2' produced before '1') consumer had send them in order (for example, '1' '2' '3' etc). account treeset being used maintain queue , in order traversal on same being done peek , remove elements. far good. has changed producer produces events in order, have decided use:-
a) linkedblockingqueue (which has fundamental property of queue in first , last element can accessed , in queue should be).
b) using lbq has taken me o(1) o(log n) in treeset.
c) no more have write explicit synchronized, reentrantlock takes care of in put , take method of lbq.
d) no more have write explicit wait/notify, lbq takes care of that.
e) lbq has 2 locks, , hence put , take can take simultaneously on different cpus.
f) lbq uses cas maintain queue of waiting threads.
all things seem me. stuck, here following questions:-
a) need able prove advantages of using lbq on treeset, collecting few metrics. free profiler should use eclipse proceed ? visual vm fine there better option available ?(introscope used in explicit runs of application , not on local eclipse, that's constraint can't fight, tptp rejected).
b) how prove increase in throughput (which looks there on paper) because of use of 2 locks in linkedblockingqueue ? it's important aspect want see , prove.
thanks
you can try use visual vm or netbeans profiler if want visualize memory/thread use .
Comments
Post a Comment