上一页 1 ··· 71 72 73 74 75 76 77 78 79 ··· 103 下一页
摘要: 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)
摘要: 阻塞状态(Blocked) 线程运行过程中,可能由于各种原因进入阻塞状态: 1>线程通过调用sleep方法进入睡眠状态; 2>线程调用一个在I/O上被阻塞的操作,即该操作在输入输出操作完成之前不会返回到它的调用者; 3>线程试图得到一个锁,而该锁正被其他线程持有; 4>线程在等待某个触发条件; .. 阅读全文
posted @ 2018-01-23 18:30 zzfx 阅读(1310) 评论(0) 推荐(0)
摘要: 黑幕背后的Autorelease http://www.cnblogs.com/feng9exe/p/7239552.html objc_autoreleasePoolPush的返回值正是这个哨兵对象的地址,被objc_autoreleasePoolPop(哨兵对象)作为入参,于是: 假设这些都有线 阅读全文
posted @ 2018-01-23 17:47 zzfx 阅读(150) 评论(0) 推荐(0)
摘要: Thread Control Block The following is the declaration of the Thread Control Block. unsigned int status This field holds the status information of the 阅读全文
posted @ 2018-01-23 17:02 zzfx 阅读(235) 评论(0) 推荐(0)
摘要: #define pthread_cleanup_push(func, val) \ { \ struct __darwin_pthread_handler_rec __handler; \ pthread_t __self = pthread_self(); \ __handler.__routin 阅读全文
posted @ 2018-01-22 21:57 zzfx 阅读(182) 评论(0) 推荐(0)
摘要: 基本概念pthread_cancel调用并不等待线程终止,它只提出请求。线程在取消请求(pthread_cancel)发出后会继续运行,直到到达某个取消点(CancellationPoint)。取消点是线程检查是否被取消并按照请求进行动作的一个位置. 与线程取消相关的pthread函数int pth 阅读全文
posted @ 2018-01-22 21:24 zzfx 阅读(221) 评论(0) 推荐(0)
摘要: 资源分为两类: 1)系统维护的资源; 2)线程自身维护的资源:文件语柄、同步变量等; 线程自身维护的资源需要自身来释放。 资源使用、同步使用; 资源清理: 线程pthread_cleanup_push的简单例程. 阅读全文
posted @ 2018-01-22 21:23 zzfx 阅读(153) 评论(0) 推荐(0)
摘要: Concurrency is when two tasks can start, run, and complete in overlapping time periods. Parallelism is when tasks literally run at the same time, eg. 阅读全文
posted @ 2018-01-22 21:13 zzfx 阅读(143) 评论(0) 推荐(0)
摘要: 与动态语言有关的概念:1、反射 2、运行时 3、编译器、静态。 所谓的动态语言指的是语言单元的结构、行为、类型可以在运行时发生改变的语言。 可以动态添加新的类型; Dynamic programming language, in computer science, is a class of hig 阅读全文
posted @ 2018-01-21 10:07 zzfx 阅读(391) 评论(0) 推荐(0)
摘要: In object-oriented programming, a metaclass is a class whose instances are classes. Just as an ordinary class defines the behavior of certain objects, 阅读全文
posted @ 2018-01-20 23:14 zzfx 阅读(137) 评论(0) 推荐(0)
摘要: In some languages, classes are only a compile-time feature (new classes cannot be declared at runtime), while in other languages classes are first-cla 阅读全文
posted @ 2018-01-20 22:45 zzfx 阅读(156) 评论(0) 推荐(0)
摘要: eval is a function which evaluates a string as though it were an expression and returns a result; in others, it executes multiple lines of code as tho 阅读全文
posted @ 2018-01-20 22:11 zzfx 阅读(187) 评论(0) 推荐(0)
摘要: 线程的关系就如同一个家庭里父子关系、独生子、多兄弟的关系; 有控制、独立完成、协作完成、资源竞争等情况发生。 同时线程具有生命周期,由生老病死等情况发生。 或者如同一个工厂的构成: 工厂拥有所有资源; 员工和管理者各司其职; 竞争使用资源或协作完成任务。 1、单任务线程,除了启动和完成没有和其它线程 阅读全文
posted @ 2018-01-19 22:02 zzfx 阅读(217) 评论(0) 推荐(0)
摘要: 线程的核心是算法,是面向过程的。 算法的协作的控制就相当于线程间的关系。 阅读全文
posted @ 2018-01-19 21:58 zzfx 阅读(239) 评论(0) 推荐(0)
摘要: 线程的阻塞状态与线程控制结构密切相关; 线程的阻塞点是同步变量的部署点; 线程的取消点是线程的死亡点。 阅读全文
posted @ 2018-01-19 21:57 zzfx 阅读(141) 评论(0) 推荐(0)
上一页 1 ··· 71 72 73 74 75 76 77 78 79 ··· 103 下一页