-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Description
- Type: Enhancement
Enhancement
When looking at the code for crypto hardware acceleration, we noticed that there are many locations where a command is issued to the accelerator, then the thread must must wait for the operation to be completed. The mbed TLS API is mostly synchronous, so for lack of an alternative mechanism, the thread simply is set to busy wait until the accelerator has finished. This behaviour is inefficient as those CPU cycles could be used to execute another thread instead of manually checking on a condition.
Suggested enhancement
An idea to avoid the busy waits mentioned above is to have some mechanism that enabled HAL code to issue a command for the accelerator or a peripheral and then wait on a condition that would be satisfied (e.g. by means of a semaphore) when the operation has completed.
Pros
Threads can more efficiently be scheduled and blocking in the form of busy waiting for events to occur can be avoided in a much easier way.
Cons
Probably there might be issues with backwards compatibility when adding this new feature.