From: Doug M. <do...@hy...> - 2010-02-02 22:50:57
|
Hi Gerald, Your synopsis on both classes is correct, there is a bit more detail on SigarProxyCache here: http://forums.hyperic.com/jiveforums/thread.jspa?threadID=628 Glad you appreciate the Humidor name! You would only need a Humidor to share a Sigar object between multiple threads. Sigar uses the reentrant versions of libc (or similar) functions underneath and any state is encapsulated with the underlying sigar_t object (no static variables). So, there is no synchronization required if each thread is using its own instance of a Sigar object. Looks like the ProcessFinder is hardwired to expect a SigarProxyCache impl: /** * @deprecated */ public ProcessFinder(SigarProxy proxy) { this(SigarProxyCache.getSigar(proxy)); } SigarProxy usage with ProcessFinder is also deprecated as of 1.5, when we ported the PTQL impl from Java to C. Even if ProcessFinder handled the Humidor case, the synchronization would be by-passed as would the caching of SigarProxyCache. So, if you're not making concurrent calls to ProcessFinder.find, the fix would be just to pass your Sigar curSigar object instead. Otherwise, you should synchronize the calls to ProcessFinder. And in any case we should add synchronization support to the ProcessFinder so you don't have to worry about it: http://jira.hyperic.com/browse/SIGAR-204 -Doug |