On Fri, 22 Oct 2004, Olivier Tarnus wrote:
I was wondering if it's possible to open multiple contexts and specifying
them in pmFetch or pmLookupDesc... I want to get multiple data from multiple
hosts in the same program, and as pmapi is not thread safe, the only
alternative would be to go multi-process and opening contexts in each
process.
Olivier,
you can create as many contexts are needed, to the same or
different hosts. The pmNewContext(3) call returns a unique
handle that can be passed to any of the following functions
to manage contexts :
pmDestroyContext(3), pmDupContext(3), pmReconnectContext(3),
pmUseContext(3), pmWhichContext(3)
In your case, just create a new context to each host and then
call pmUseContext(3) to set the current context before each
pmFetch.
Thanks
-- Mark
|