Directory locking

Can a directory listing block other 1-wire tasks?

It can be useful to have several programs acquiring data from the 1-wire bus. Perhaps a data collection, control, and display are all performed by different programs on their own schedule.

Although the final throughput of the 1-wire bus is limited by communication and device speeds, the granularity of the task locking will affect data latency. On a 1-wire network with many devices, getting a list of devices (the search function) can take a relatively long time. Can other tasks be interspersed?

  • Threaded version

    Unless specifically compiled without threading, owserver, owfs, owhttpd ... are multithreaded. This means that more than one task can be perfomed "at the same time." Actually it means that more than one task can be intermixed, usually while the task is waiting for some slower hardware response. OWFS has a advanced heirarachy of locks (mutexes) that prevent threads from interfering.

  • Cache

    Directory contents are cached for faster response. If the directory is already in the cache, no appreciable delay to other tasks will occur. Of course requesting the uncached directory will require a new hardware search (and cache updating).

  • Different busses

    When more than one 1-wire adapter is used, a directory search will be initiated in each independently (in separate threads). The total latency will be the maximum of the individual latencies.

  • Adapter type

    In order to allow other threads access to the same 1-wire bus during a directory search, the discovery process must be interrupted and resumed. Some adapters (like the serial DS9097U) store and resume the search state easily. Other adapters, like the LINK cannot resume the discovery process if another thread demands access. Still other adapters, like the HA7Net only respond with a full directory list for a single query.

  • DS2409 branches

    The DS2409 allows "subdirectories" on a 1-wire network. This branch can be individually selected, but not all adapters can handle the branches easily.

  • Detail table


 Adapter TypeMain granularity
Branch granularity
Handles branches
 Passive (DS9097)
serial
1
1
yes
 DS9097U (DS2480B based)
serial
1
1
yes
 LINK (ascii mode)
serial
all
N/A
no
 DS9490 (DS2490 based)
USB
7
1
yes
 LINK-HUB-E
tcp
all
N/A
no
 HA7Net
tcp
all
N/A
no
     
     

Previous page: Object read process
Next page: Slave support