Movatterモバイル変換


[0]ホーム

URL:


homepage

Message321672

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Authorammar2
Recipientsammar2, giampaolo.rodola, jkloth, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date2018-07-15.02:57:00
SpamBayes Score-1.0
Marked as misclassifiedYes
Message-id<1531623421.59.0.56676864532.issue34060@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks a lot for that link Jeremy, it was really helpful. After reading up on it, my take is that winapi is the most appropriate place for this, it is a non public api that's used in the stdlib.I've used Windows APIs in a way that we don't need to manually start up a thread and call a calc_load function, instead using a callback invoked by windows. Internally this uses a thread pool, but it means we don't have to worry about managing the thread ourselves.The load is stored as a global but the winapi module is already marked as "-1" indicating it has global state, so that shouldn't be a problem.https://docs.python.org/3/c-api/module.html#c.PyModuleDef.m_sizeLike Jeremy noted, using WMI does add a 5mb overhead or so to the calling process. One more caveat is that the PdhAddEnglishCounterW function is only available in Vista+. I'm not sure if we still support Windows XP, but the alternative is to use PdhAddCounter, which breaks if the system language is not english because the counter paths are localized.
History
DateUserActionArgs
2018-07-15 02:57:01ammar2setrecipients: +ammar2,paul.moore,vstinner,giampaolo.rodola,tim.golden,jkloth,zach.ware,steve.dower
2018-07-15 02:57:01ammar2setmessageid: <1531623421.59.0.56676864532.issue34060@psf.upfronthosting.co.za>
2018-07-15 02:57:01ammar2linkissue34060 messages
2018-07-15 02:57:00ammar2create
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp