Comments (1)
I am glad you like it. I never tried using it from another thread.
- There is no reason why it wouldn't work from another thread. Running from the main thread is usually only important for the user interface methods, especially when dealing with events.
- No,
HardwareInfo
is not thread safe. If you callRefreshAll()
from one thread, you can't safely access the public properties from another thread. You could make it thread safe by usinglock
on, (for example)List<CPU> CpuList
and callingRefreshCPUList()
in one thread and using anotherlock
onList<CPU> CpuList
where you read it in another thread. - What do you mean by
used in async context
? Any synchronous method can be called from aasync
method without a problem. Do you mean if you canawait RefreshAll()
? No, you can'tawait
it directly, but you can useawait Task.Run(() => hardwareInfo.RefreshAll());
to run it in another thread - just remember thatRefreshAll()
has to finish before you can access the results.
from hardware.info.
Related Issues (20)
- Not work in console app HOT 2
- VideoController.AdapterRAM does not report > 4GB HOT 4
- Very little info seems to be collected on Debian HOT 2
- Network speed is set to 0 or set to long.MaxValue in certain circumstances HOT 7
- System.Management currently is only supported for Windows desktop applications HOT 3
- Network interfaces cannot be refreshed when the available address families are restricted with systemd HOT 11
- On Win7 system, an exception is triggered with the message 'Could not locate Performance Counter with specified category name 'Processor Information', counter name '% Processor Performance' HOT 2
- `WmiNetUtilsHelper` exception if `PublishTrimmed` is `true` HOT 3
- Not all Monitors/Screens returned on Windows HOT 5
- Incorrent CPU information for multiprocessor platforms on Linux HOT 3
- CPU usage HOT 2
- Use semantic versioning for package releases HOT 1
- Lack of information on Linux HOT 9
- Computer Model and Manufacturer HOT 2
- GPU Usage Infomation
- Drive info not available in Linux HOT 5
- About the timeout exception. HOT 3
- Question: Obtaining CPU Utilization Metrics HOT 5
- Curious about AOT compilation HOT 2
- Windows support without WMI HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hardware.info.