-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
10-ConcurrencyAndSynchronization: Homework task
Signed-off-by: Aleksandr Bulyshchenko <[email protected]>
- Loading branch information
1 parent
c450e30
commit 925cbef
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Concurrency and synchronization | ||
|
||
## Homework | ||
|
||
**(based on MPU6050 driver)** | ||
|
||
_NB_: | ||
Communication with peripheral device on i2c is quite slow asynchronous process | ||
which responsiveness depends on the slave latency and bus utilisation. | ||
Thus generally it's better to be done in background process. | ||
|
||
1. Move interaction with MPU6050 into separate thread. | ||
|
||
2. Protect static data of the driver (`g_mpu6050_data` in the master) | ||
for the case of concurrent access. | ||
|
||
3. Limit interaction with MPU6050 in case of frequent requests: | ||
Define validity interval - if the latest read data is older than this threshold | ||
then new data reading is performed, otherwise previously read data is returned. | ||
(This threshold should be configurable parameter with reasonable default.) | ||
|