aquayi / distributed-algorithms Goto Github PK
View Code? Open in Web Editor NEW利用 Go 语言实现多种分布式算法
License: MIT License
利用 Go 语言实现多种分布式算法
License: MIT License
$ git checkout 00c7877
$ go build -o me.exe
$ ./me.exe
...
14:25:49.227003 ## {确认收到, Time:3449, From:1, To:0, <T3446:P0>}
14:25:49.227015 ## {申请资源, Time:3445, From:1, To:-1, <T3444:P1>}
14:25:49.227018 ## {确认收到, Time:3451, From:0, To:1, <T3444:P1>}
14:25:49.227004 [3452]P1 准备占用资源 {request queue:<T3444:P1><T3446:P0>}
panic: 资源正在被 <T3446:P0> 占据,<T3444:P1> 却想获取资源。
...
从上图的 log 可以清除地看到,P1 先回复 P0 收到了 T3446:P0 消息,然后才发布了 T3444:P1 申请资源的消息。这导致了 T3446:P0 抢先占用资源,引发 panic。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.