-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concurrency issue with latest modification #7
Comments
Merged
dsjzn
added a commit
that referenced
this issue
Jun 27, 2017
Resolve issue #7, really thanks lafrank.
Laszlo,
Really thanks for your kindly help, that would be very helpful for thousands of lattepanda user.
Is there any other problem or suggestion about the library or lattepanda? any information will be very helpful.
Looking forward to your reply, thanks.
Best Regards,
Kelvin Sun
LattePanda Team
www.lattepanda.com<http://www.lattepanda.com>
…________________________________
From: Laszlo Frank <notifications@github.com>
Sent: Sunday, June 25, 2017 5:13:45 PM
To: LattePandaTeam/LattePanda-Development-Support
Cc: Subscribed
Subject: [LattePandaTeam/LattePanda-Development-Support] Concurrency issue with latest modification (#7)
Although I think it is a very useful and great work, I also believe - but could be wrong - that there is a serious concurrency issue with latest modification "Update Arduino library for less CPU consumption".
This change has introduced a thread that initiates a timed event that is called in every 30ms to read the serial port, a much better approach than the original code. The problem is however, that the timer will tick and initiate a new call disregarding whether the execution of the previous call has finished or not. This results is multiple, simultaneously running instances of InputProcessor.InputProcess() method.
In my view, InputProcessor.InputProcess() should be enclosed in a Monitor.TryEnter(_serialPort) and Monitor.Exit(_serialPort) try-finally clause to prevent parallel execution.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#7>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AQGbkwPZ1W8zlJKXxmFzIRgVLorYs-oaks5sHiTJgaJpZM4OEjrB>.
|
Hi Kelvin,
Yes, there are a few other modifications what I already pushed to my fork.
Only these are not tested so currently I am not creating a pull request.
Kind Regards,
Laszlo
…On Tue, Jun 27, 2017 at 5:57 AM, LattePanda ***@***.***> wrote:
Laszlo,
Really thanks for your kindly help, that would be very helpful for
thousands of lattepanda user.
Is there any other problem or suggestion about the library or lattepanda?
any information will be very helpful.
Looking forward to your reply, thanks.
Best Regards,
Kelvin Sun
LattePanda Team
www.lattepanda.com<http://www.lattepanda.com>
________________________________
From: Laszlo Frank ***@***.***>
Sent: Sunday, June 25, 2017 5:13:45 PM
To: LattePandaTeam/LattePanda-Development-Support
Cc: Subscribed
Subject: [LattePandaTeam/LattePanda-Development-Support] Concurrency
issue with latest modification (#7)
Although I think it is a very useful and great work, I also believe - but
could be wrong - that there is a serious concurrency issue with latest
modification "Update Arduino library for less CPU consumption".
This change has introduced a thread that initiates a timed event that is
called in every 30ms to read the serial port, a much better approach than
the original code. The problem is however, that the timer will tick and
initiate a new call disregarding whether the execution of the previous call
has finished or not. This results is multiple, simultaneously running
instances of InputProcessor.InputProcess() method.
In my view, InputProcessor.InputProcess() should be enclosed in a
Monitor.TryEnter(_serialPort) and Monitor.Exit(_serialPort) try-finally
clause to prevent parallel execution.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<https://github.com/
LattePandaTeam/LattePanda-Development-Support#7>, or mute the
thread<https://github.com/notifications/unsubscribe-auth/
AQGbkwPZ1W8zlJKXxmFzIRgVLorYs-oaks5sHiTJgaJpZM4OEjrB>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AO-XZIN8GfOKFHFNeS5enzSo-ImTWpyJks5sIH2ogaJpZM4OEjrB>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Although I think it is a very useful and great work, I also believe - but could be wrong - that there is a serious concurrency issue with latest modification "Update Arduino library for less CPU consumption".
This change has introduced a thread that initiates a timed event that is called in every 30ms to read the serial port, a much better approach than the original code. The problem is however, that the timer will tick and initiate a new call disregarding whether the execution of the previous call has finished or not. This results is multiple, simultaneously running instances of InputProcessor.InputProcess() method.
In my view, InputProcessor.InputProcess() should be enclosed in a Monitor.TryEnter(_serialPort) and Monitor.Exit(_serialPort) try-finally clause to prevent parallel execution.
See pull request #8 for details
The text was updated successfully, but these errors were encountered: