How to get list of processes efficiently

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to get list of processes efficiently

emil
Hello,
I have to retrieve the list of all processes from remote windows machine. Now I I get them using 
function "wsmc_action_enumerate_and_pull" (C language) and using filter: 
select * from Win32_PerfRawData_PerfProc_Process where Name!='_Total' and Name!='Idle'
The problem is that it takes some time (about 10 seconds), which is too long for me. Is it any better way which can get the list of processes much faster, which is more efficient?
Thanks for any help.
Cheers

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to get list of processes efficiently

Klaus Kaempf
* Emil Bartczak <[hidden email]> [Feb 26. 2015 10:56]:
> Hello,
> I have to retrieve the list of all processes from remote windows machine.
> Now I I get them using
> function "wsmc_action_enumerate_and_pull" (C language) and using filter:
> select * from Win32_PerfRawData_PerfProc_Process where Name!='_Total' and
> Name!='Idle'

This approach is correct.

> The problem is that it takes some time (about 10 seconds), which is too
> long for me. Is it any better way which can get the list of processes much
> faster, which is more efficient?

Yes, you can influence this via the ClientOptions
- set "FLAG_ENUMERATION_OPTIMIZATION" in the ClientOptions.flags
- set ClientOptions.max_elements to a large value


This will return 'max_elements' elements as a result of the
'wsmc_action_enumerate_and_pull' call.
You'll only need to 'pull' if the total number of elements exceeds the
max_elements value. Each pull will return up to max_elements elements.


Klaus
--
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to get list of processes efficiently

emil
Thanks for your help. 
I set max_elements to 1000 and optimization flag and now retrieving the list of processes takes about 2 second.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Loading...