Skip to content

Code extracted from Paint.NET for obtaining information about the CPU from the Win32 GetLogicalProcessorInformation API

License

Notifications You must be signed in to change notification settings

paintdotnet/PaintDotNet.ProcessorInformation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PaintDotNet.ProcessorInformation

Code extracted from Paint.NET for obtaining information about the CPU from the Win32 GetLogicalProcessorInformation API. Someone needed this over on Discord :) I haven't pruned or even built this code, it's lifted directly from the Paint.NET code base.

Start by looking at Processor.cs::GetLogicalProcessorInformation(). There are some handy extension methods in LogicalProcessorInfoExtensions for getting the logical and physical core counts. Paint.NET uses this to establish the min/max bounds for worker thread counts. Most of the time, only the physical core count is used -- this helps leave breathing room for the UI thread, and for other in-process threadpools (mostly WARP, DirectX). When running things like effects, the thread count is ramped up to the logical core count, which does help rendering throughput quite a lot.

About

Code extracted from Paint.NET for obtaining information about the CPU from the Win32 GetLogicalProcessorInformation API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages