Skip to content
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

Implement concurrency management #3

Closed
ckamps opened this issue Jan 7, 2020 · 3 comments
Closed

Implement concurrency management #3

ckamps opened this issue Jan 7, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@ckamps
Copy link
Owner

ckamps commented Jan 7, 2020

Support concurrency management by requesting a lock of the 1-Wire bus from the HA7Net at the start of each operation. See the HA7Net User's Manual and Programmer's Guide for details.

@ckamps ckamps added the enhancement New feature or request label Jan 7, 2020
@ckamps
Copy link
Owner Author

ckamps commented Jan 12, 2020

Analysis of HA7Net Concurrency Management and Locking Support

It appears that for most of the operations supported by these drivers, explicit HA7Net concurrency management is not needed and indeed not even supported by the HA7Net.

The one HA7Net interface currently used by these drivers that supports passing lock IDs is the /1Wire/Search.html interface. Other, higher level interfaces that are used by these drivers including /1Wire/ReadHumidity.html and /1Wire/ReadTemperature.html do not appear to support passing lock IDs.

It is believed that for these higher level interfaces, the HA7Net performs its own concurrency management as it carries out multiple actions on the 1-Wire bus for each invocation of the higher level interface.

Further, it is believed that when multiple requests for higher level interfaces occur, the HA7Net will queue them until either the currently executing higher level action has completed or a lock obtained by a client is either released or expires.

I have an outstanding email support request to the folks at EDS to confirm these understandings.

Recommended Enhancements

Given this understanding, it's recommended that the parent driver be enhanced to support concurrency management and locking when using the /1Wire/Search.html interface.

Additionally, since the multiple timeouts have occurred per day in at least one deployment of these drivers and the default HA7Net lock timeout value is 60 seconds, it's recommended that users of these drivers reduce the lock timeout value to 5 or so seconds.

@ckamps
Copy link
Owner Author

ckamps commented Jan 12, 2020

This issue will be left open until confirmation of the assumed locking behavior is received from EDS support.

ckamps added a commit that referenced this issue Jan 12, 2020
#3 - remove lock ID from sensor type check call
@ckamps
Copy link
Owner Author

ckamps commented Jan 13, 2020

Per EDS support:

When you’re using the HA7Net’s “High-Level” interfaces to read 1Wire devices (Temperature.html in this case), you don’t need to worry about concurrency management on the 1-Wire bus, because as designed, the HA7Net’s high level interfaces handle that internally. i.e., when the HA7Net begins to process a high level request, it insures no other requests will touch the 1Wire bus until that high level request is complete. This is why we didn’t add support for the LockID parameter on the high level urls.

Which pretty much confirms what I was thinking.

Closing out this issue given that locking has been implemented for the Search interface, the only interface that the drivers currently use that supports the lock I’d.

@ckamps ckamps closed this as completed Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant