【发布时间】:2012-10-17 14:02:24
【问题描述】:
在 Solaris 10 中采用进程的 truss 时, 我找到了下面的语句
<pid>/2: 70.7602 context(1, 0xFC47ABF8)
请解释一下这个系统调用context是什么意思
同样在此调用之后,我看到线程 2 的行为类似于另一个线程 4。
【问题讨论】:
标签: multithreading solaris truss
在 Solaris 10 中采用进程的 truss 时, 我找到了下面的语句
<pid>/2: 70.7602 context(1, 0xFC47ABF8)
请解释一下这个系统调用context是什么意思
同样在此调用之后,我看到线程 2 的行为类似于另一个线程 4。
【问题讨论】:
标签: multithreading solaris truss
<ucontext.h>
int getcontext(ucontext_t *ucp);
int setcontext(const ucontext_t *ucp);`
这两个调用在 Solaris 中保存和恢复上下文。
我不确定,因为在 McDougal 和 Mauro 的“Solaris Internals”中没有明确提到 context()。
我假设context() 是对应这些 api 入口点的实际内核调用。
也许context(1, <addr> )对应getcontext(),我不知道。
上下文切换是操作系统允许给定进程在给定时间片(时间片)内使用系统资源的方式。日程安排的一部分。
【讨论】: