Skip to content
This repository has been archived by the owner on Jan 3, 2020. It is now read-only.

CPU core is fully utilized after calling Firmate.begin() #114

Closed
Qowy opened this issue Feb 25, 2017 · 1 comment
Closed

CPU core is fully utilized after calling Firmate.begin() #114

Qowy opened this issue Feb 25, 2017 · 1 comment
Assignees

Comments

@Qowy
Copy link

Qowy commented Feb 25, 2017

Due to the constantly polling nature of the inputThread() listening for messages from the serial connection one CPU core is fully utilized during the entire runtime of the Firmata class.

#113 proposes a simple optional fix that allows one to specifiy a polling intervall during constuction of the UwpFirmata class.

#115 Is a nicer solution but requires a change to Microsoft.Maker.Serial.ISerial (ms-iot/serial-wiring#20) that introduces (in order to not change existing functionality) a readBlocking() method that puts the current thread to sleep until LoadAsync() is complete

I also experimented with a solution that exposes ISerial::available() and read() (or would introduce availableAsync() etc.) as IAsyncOperation<uint16_t>,
however this would require even more changes to the ISerial interface and is complex to do with the create_task().then() approach.

co_await might make it easy, but I am unsure if using #include <experimental\resumable> is allowed in such a low level library

@saraclay
Copy link

If this issue is still relevant, please file this at: https://github.com/MicrosoftDocs/windows-iotcore-docs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants