0

While taking the truss of a process in Solaris 10, I found the below statement

<pid>/2:    70.7602 context(1, 0xFC47ABF8)

Please explain what this system call context means Also after this call I saw thread 2 behaving like another thread 4.

beaver
  • 523
  • 1
  • 9
  • 20
aehjaj
  • 51
  • 4

1 Answers1

0
<ucontext.h>
int getcontext(ucontext_t *ucp);
int setcontext(const ucontext_t *ucp);`

These two calls save and restore a context in Solaris. I do not know positively, as there is no explicit mention of context() in McDougal And Mauro 'Solaris Internals'. I assume context() is the actual kernel call that corresponds these api entry points. Perhaps context(1, <addr> ) corresponds to getcontext(), I do not know.

Context switching is how an OS allows a given process to use system resources for a given quantum (time slice). Part of scheduling.

beaver
  • 523
  • 1
  • 9
  • 20
jim mcnamara
  • 16,005
  • 2
  • 34
  • 51