Skip to content

Commit ff0a738

Browse files
Clarify thread safety in IoT libraries (#48264)
* Clarify thread safety in IoT libraries Added a section on thread safety for library objects. * Update thread safety explanation in intro.md Rewrote to be more accurate and hopefully more readable. * Update docs/iot/intro.md Co-authored-by: Meaghan Osagie (Lewis) <[email protected]> --------- Co-authored-by: Meaghan Osagie (Lewis) <[email protected]>
1 parent f161ad2 commit ff0a738

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/iot/intro.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ Some commonly used device bindings include:
4646
- [Max7219 - LED Matrix driver](https://github.com/dotnet/iot/tree/main/src/devices/Max7219)
4747
- [RGBLedMatrix - RGB LED Matrix](https://github.com/dotnet/iot/tree/main/src/devices/RGBLedMatrix)
4848

49+
## A word on threads
50+
51+
By default, the objects in these libraries **aren't thread safe**. That means that access to an object must only be from one thread at a time. When using the libraries, you must be aware that they often run other threads internally for things like monitoring hardware and firing events. If you subscribe to an event, it's fired from a different thread. It's your responsibility to control thread access to the object.
52+
4953
## Supported operating systems
5054

5155
`System.Device.Gpio` is supported on any operating system that supports .NET, including most versions of Linux that support ARM/ARM64 and Windows 10 IoT Core.

0 commit comments

Comments
 (0)