摘要:
In software engineering, concurrency patterns are those types of design patterns that deal with the multi-threaded programming paradigm. Examples of t 阅读全文
posted @ 2018-01-24 19:07
zzfx
阅读(185)
评论(0)
推荐(0)
摘要:
1)函数调用栈的构建与销毁; 2)函数调用栈的要素:(1)局部变量;2)调用参数;(3)返回地址、(4)寄存器保存; 阅读全文
posted @ 2018-01-24 16:31
zzfx
阅读(171)
评论(0)
推荐(0)
摘要:
In computer science, a calling convention is an implementation-level (low-level) scheme for how subroutines receive parameters from their caller and h 阅读全文
posted @ 2018-01-24 16:20
zzfx
阅读(259)
评论(0)
推荐(0)
摘要:
C 语言中函数返回结构体时如果结构体较大, 则在调用函数中产生该结构的临时变量,并将该变量首地址传递给被调用函数,被调用函数返回时根据该地址修改此临时变量的内容,之后在调用函数中再将该变量复制给用户定义的变量,这也正是 C 语言中所谓值传递的工作方式。 如果结构体较小, 则函数返回时所用的临时变量可 阅读全文
posted @ 2018-01-24 15:35
zzfx
阅读(326)
评论(0)
推荐(0)
摘要:
官方说法: 函数pthread_join用来等待一个线程的结束。函数原型为: extern int pthread_join __P ((pthread_t __th, void **__thread_return)); 第一个参数为被等待的线程标识符,第二个参数为一个用户定义的指针,它可以用来存储 阅读全文
posted @ 2018-01-24 10:52
zzfx
阅读(1413)
评论(0)
推荐(0)
摘要:
线程退出油多种方式,如return,pthread_exit,pthread_cancel等;线程分为可结合的(joinable)和 分离的(detached)两种,如果没有在创建线程时设置线程的属性为PTHREAD_CREATE_DETACHED,则线程默认是可结合的。可结合的线程在线程退出后不会 阅读全文
posted @ 2018-01-24 10:47
zzfx
阅读(1164)
评论(0)
推荐(0)