From 213363383b5864d236cfce711920f76a2450de07 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 16 Jun 2021 20:18:19 +0800 Subject: import(life): ... --- .../operating-system-experiment/DeadLockDetectionDemo.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'works/life') diff --git a/works/life/operating-system-experiment/DeadLockDetectionDemo.cpp b/works/life/operating-system-experiment/DeadLockDetectionDemo.cpp index e043161..bea2b43 100644 --- a/works/life/operating-system-experiment/DeadLockDetectionDemo.cpp +++ b/works/life/operating-system-experiment/DeadLockDetectionDemo.cpp @@ -1,3 +1,13 @@ +// Demo使用方法: +// 本程序采用标准C++11代码写成,请使用支持C++11的编译器编译。 +// +// 程序接受的输入为n个整数对,其中1-10000表示进程,10001及以上表示锁,顺序很重要: +// 1 10001 -> process 1 is acquiring or waiting for lock 1 +// 10001 1 -> lock 1 is owned by process 1 +// +// 建议采用重定向输入至文件的方式输入,提供4个典型情况的测试数据。 +// + #include #include #include @@ -50,9 +60,6 @@ bool dfs( return false; } -// 1 10001 -> process 1 is waiting for lock 10001 -// 10001 1 -> lock 10001 is owned by process 1 - int main() { std::vector ns; -- cgit v1.2.3