死锁与活跃度前面谈了很多并发的特性和工具,但是大部分都是和锁有关的。我们使用锁来保证线程安全,但是这也会引起一些问题。锁顺序死锁(lock-ordering deadlock):多个线程试图通过不同的顺序获得多个相同的资源,则发生的循环锁依赖现象。动态的锁顺序死锁(Dynamic Lock Orde...
分类:
编程语言 时间:
2014-12-03 00:03:03
阅读次数:
296
题目大意:
用N份工作,M组关系,例如关系A,B表示要先完成B,才能完成A,让你输出一组工作完成的顺序。
解题思路:
拓扑排序。...
分类:
编程语言 时间:
2014-11-22 17:36:41
阅读次数:
163
Given a graph (V,E) where V is a set of nodes and E is a set of arcs in VxV, and an
ordering on the elements in V, then the bandwidth of a node
v is defined as the maximum distance in the ordering ...
分类:
其他好文 时间:
2014-11-21 23:21:51
阅读次数:
285
1940_Ordering_Tasks题目链接:http://soj.me/1940题目大意:输入n和m,n代表任务的个数,m代表任务间先后关系的个数.后面输入m个先后关系,比如1 4表示任务1要在任务4之前完成.找到一种完成所有任务的顺序,满足所有要求的先后顺序,有多个解时要求输出字典序最小的.思...
分类:
其他好文 时间:
2014-11-13 10:34:45
阅读次数:
180
为了将html页面和python代码分离开来,有必要介绍一下模板的作用,Django中自带许多模板。
下面一个html模板文件:
Ordering notice
Ordering notice
Dear {{ person_name }},
Thanks for placing an order from {{ company }}. It's scheduled to
ship ...
分类:
其他好文 时间:
2014-11-09 16:41:30
阅读次数:
115
扩展已有的用户模型Extending the existing User model有两种方法来扩展默认的User Model而不用重写自己的模型。如果你不需要改变存储在数据库中的字段,而只是需要改变Model的行为,您可以创建一个基于User的代理Model。允许的行为包括默认的ordering,...
分类:
其他好文 时间:
2014-10-30 07:05:45
阅读次数:
288
In cases like this, where the independent variable does not have an intrinsic ordering, it isoften a good idea to sort entries by the dependent variab...
分类:
其他好文 时间:
2014-10-24 12:32:15
阅读次数:
233
并行编程是 CPU 进入多核时代后一个非常重要的方面,要想掌握并行编程,一些基础的知识非常重要。...
分类:
系统相关 时间:
2014-10-24 10:57:45
阅读次数:
222
An improved memory model and implementation is disclosed. The memory model includes a Total Store Ordering (TSO) and Partial Store Ordering (PSO) memo...
分类:
移动开发 时间:
2014-10-14 02:05:27
阅读次数:
442