Luggage locks

October 27, 2007

Samsonite locks Ribble Link

Filed under: Uncategorized — Tags: , — admin @ 12:40 am

The Ribble Link is Great Britain’s newest inland waterway, opened in 2002. The four-mile link connects the once-isolated Lancaster Canal with the main navigable system via a canalisation of the Savick Brook which is tidal in its lower reaches. The Link runs around the outskirts of Preston and flows into the River Ribble. From there it uses the River Douglas to connect with the Leeds and Liverpool Canal’s Rufford Branch.

The channel has been widened to allow navigation by 10 ft 6 in beam boats. Starting from the Lancaster Canal, the Ribble Link descends about 59 feet (18 metres) by means of:

  • a staircase of three locks
  • four conventional locks
  • one lock which is semi-tidal at its lower end
  • a rotating sector gate (originally planned as a lock) only passable around high tide.

Closure

The Ribble Link was indefinitely closed during 2006 with British Waterways citing that the appearance of voids meant that the last section was too dangerous to operate for both British Waterways staff and boaters.British Waterways notice posted at Johnson Hillock Locks, Whittle Springs 2006. After dredging and infilling behing lock chambers during the winter of 2006-7, the link was re-opened on 6 April 2007.

References

  • Ribble Link Trust
  • October 22, 2007

    Locking suitcases Test and Test-and-set

    Filed under: Uncategorized — Tags: , — admin @ 12:15 pm

    In computer science, the test-and-set CPU instruction is used to implement
    mutual exclusion in multiprocessor environments. Although a correct lock can be implemented with test-and-set, it can lead to memory contention in busy lock (caused by bus locking and cache invalidation when test-and-set operation needs to access memory atomically).

    To lower the overhead a more elaborate locking protocol test and test-and-set
    is used. The main idea is not to spin in test-and-set but increase the likelihood of successful test-and-set by using following entry protocol to the lock:

    boolean locked := false // shared lock variable
    procedure EnterCritical() {
      do {
        while (locked == true) skip // spin until lock seems free
      } while TestAndSet(locked) // actual atomic locking
    }
    

    Exit protocol is:

    procedure ExitCritical() {
      locked := false
    }
    

    The entry protocol uses normal memory reads to spin, waiting for the lock to become free. Test-and-set is only used to try to get the lock when normal memory read says its free. Thus the expensive atomic memory operations happens less often than in simple spin around test-and-set.

    If the programming language used supports minimal evaluation, the entry protocol could be implemented as:

     procedure EnterCritical() {
       while ( locked == true or TestAndSet(locked) == true )
         skip // spin until locked
     }
    

    Caveat

    Although this optimization is useful in system programming it should be avoided in high level concurrent programming. One example of bad usage of this idiom is double-checked locking, which is listed as an anti-pattern.

    Powered by WordPress