#lang racket;guo lv qi(define (filter predicate sequence) (cond ((null? sequence) '()) ((predicate (car sequence)) (cons (car sequence) ...
分类:
其他好文 时间:
2015-04-20 22:38:28
阅读次数:
169
转:http://blog.chinaunix.net/uid-11572501-id-3456343.html//pthread_cond_signal 只发信号,内部不会解锁,在Linux 线程中,有两个队列,分别是cond_wait队列和mutex_lock队列, cond_signal只是让...
分类:
其他好文 时间:
2015-04-20 16:38:20
阅读次数:
150
5.4 控制流? 语句(statement)是一条单独的R语句或一组复合语句(包含在花括号{ } 中的一组R语句,使用分号分隔);? 条件(cond)是一条最终被解析为真(TRUE)或假(FALSE)的表达式;? 表达式(expr)是一条数值或字符串的求值语句;q 序列(seq)是一个数值或字符串序...
分类:
其他好文 时间:
2015-04-15 19:11:56
阅读次数:
148
1#include2#include3#include45pthread_mutex_tmutex;6pthread_cond_tcond_full;7pthread_cond_tcond_empty;89intg_iBufSize=0;1011void*thread_producer(void*a...
分类:
系统相关 时间:
2015-04-13 01:35:18
阅读次数:
183
在上一篇介绍了linux驱动的调试方法,这一篇介绍一下在驱动编程中会遇到的并发和竟态以及如何处理并发和竞争。首先什么是并发与竟态呢?并发(concurrency)指的是多个执行单元同时、并行被执行。而并发的执行单元对共享资源(硬件资源和软件上的全局、静态变量)的访问则容易导致竞态(race cond...
分类:
系统相关 时间:
2015-04-11 23:46:47
阅读次数:
229
条件运算符形式:cond ? expr1 : expr2;在C语言中执行过程是:先对cond求值,值为真返回expr1的值,否则返回expr2的值.(右值)gcc测试结果:在Cpp中如果两个表达式都是左值的话,那么运算的结果也是左值(也就是表达式本身,我给表达式赋值并打印出来),否则就是右值。
分类:
其他好文 时间:
2015-04-11 14:48:24
阅读次数:
148
always语句下如果有判断语句if,那么if语句中的条件必须有always中的敏感变量。否则错误提示为:Error (10200): Verilog HDL Conditional Statement error at ……: cannot match operand(s) in the cond...
分类:
其他好文 时间:
2015-04-02 22:07:49
阅读次数:
298
练习4-5原文Exercise 4.5. Scheme allows an additional syntax for cond clauses, ( => ). If evaluates to a true value, then is evaluated. Its value must be a procedure of one argument; this procedure is th...
分类:
其他好文 时间:
2015-03-31 22:34:57
阅读次数:
241
1.如下代码所示:#include #include #include #include pthread_mutex_t count_lock;pthread_cond_t count_ready;int count;void *decrement_count(void *arg){ ...
分类:
其他好文 时间:
2015-03-31 10:46:34
阅读次数:
140
练习4-2原文Exercise 4.2. Louis Reasoner plans to reorder the cond clauses in eval so that the clause for procedure applications appears before the clause for assignments. He argues that this will make the...
分类:
其他好文 时间:
2015-03-30 09:35:28
阅读次数:
138