readme

来自「ace开发环境 用来开发网络程序 其运用了设计模式、多平台、C++等多种知识」· 代码 · 共 41 行

TXT
41
字号
test_rw_locks shows how to use ACE_Local_RLock, ACE_Local_WLock,ACE_Remote_RLock, and ACE_Remote_WLock.Here are the options to test_rw_locks:% ./test_rw_lock -u -i ignore deadlock -n <iterations> -r <reads> -d debug -s sleep during writes -t <threads>test_rw_locks spawns <threads> number of threads which perform thefollowing algorithm:for <iterations>  {    for <reads>      acquire read lock    for <reads>      release read lock      acquire write lock    if (sleep during writes)      sleep for 1 second    release write lock  }The output should show that multiple readers can acquire the lock forreading simultaneously (note that this also tests recursiveacquisition.)  When a writer lock is acquired, the output should showthat no thread holds a reader lock.To run a test, simply type:% ./test_rw_lockThis should show output as described above.  

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?