Skip to content

Commit e4c11f2

Browse files
authored
Clarify thread safety in IoT libraries
Added a section on thread safety for library objects.
1 parent 444dc32 commit e4c11f2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/iot/intro.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ 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+
By convention objects in these libraries are **not** designed to be **thread safe**. This means that all access to an object should be done from the thread it was created on. Be aware when using the libraries that they may run other threads internally for monitoring hardware and firing events. If you subscribe to an event it will likely be fired from a different thread.
51+
4952
## Supported operating systems
5053

5154
`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)