- 授权协议: 未知
- 开发语言: SHELL
- 操作系统: Linux
- 软件首页: http://blog.strieber.org/keyway
软件介绍
A simple lock file library.
Features
Provides mutual exclusion for scripts that require the same resource.
Requires three additional lines of code in your script, including sourcing the library.
Scripts using Keyway can be configured to either terminate or busy-wait if a resource is blocked.
Keyway will report when an external error was caught and there are lock files in the lock directory.
Usage:
acquire_lock_for "your_task_name"If the resource is not locked, your task will execute, otherwise it will terminate.
acquire_spinlock_for "your_task_name"If the resource is locked, your task will wait until the lock has been released before acquiring its own lock and executing.
Return Code Explanations:
Your application was not able to acquire lock.
There was some other problem:
Keyway could not create the lock directory.
Keyway could not create or remove a lock.
An error was caught and there are lock files in the lock directory.
An example:
#!/bin/bash source keyway_lib.sh # optionally override the lock file directory LOCK_DIR="alt-lock-dir" # attempt to lock the shared resource acquire_lock_for "your_task_name" # if the lock was successful, execute the task echo "executing critical section" # release the lock when the task is done release_lock_for "your_task_name"
并行计算导论
Ananth Grama、George Karypis、张武、毛国勇、Anshul Gupta、Vipin Kumar、程海英 / 张武、毛国勇、程海英 / 机械工业出版社 / 2005-1-1 / 49.00元
《并行计算导论》(原书第2版)全面介绍并行计算的各个方面,包括体系结构、编程范例、算法与应用和标准等,涉及并行计算的新技术,也覆盖了较传统的算法,如排序、搜索、图和动态编程等。《并行计算导论》(原书第2版)尽可能采用与底层平台无关的体系结构并且针对抽象模型来设计处落地。书中选择MPI、POSIX线程和OpenMP作为编程模型,并在不同例子中反映了并行计算的不断变化的应用组合。一起来看看 《并行计算导论》 这本书的介绍吧!
