Questions tagged [ucontext]

The header defines mcontext_t and the associated functions getcontet, setcontext, swapcontext etc. in POSIX. Often used for implementing co-routines.

64 questions
0
votes
2 answers

Retrieve the content of EBP register in linux

I need the content of EBP/RBP for retrieving the return address of a function. This address should be at the position 8(%RBP) within the stack frame ( let's consider only x86_64 bit architecture). I retrieve this value from the ucontex_t…
Giuseppe Pes
  • 7,772
  • 3
  • 52
  • 90
0
votes
3 answers

Switching Thread Contexts with SIGALRM

I have a problem. I need to implement a program that switches ucontext threads using a timer and SIGALRM but I am getting a segmentation fault when I switch threads using my evict_thread function. I believe it is the result of a race condition as…
-2
votes
2 answers

How do I know which context is active?

There are 2 questions. 1. Can I find out which context is currently active ? 2. Can I pass in somehow a ucontext, from one function to another as an argument . I want to do something like this.: //Instead of this #include
AlexChek
  • 13
  • 2
-2
votes
1 answer

C/Multithreading /Segmentation fault / (May be) Issue with queue for the threads

I am trying to create thread library.For this I am trying to implement queue to store the pending threads to be executed. #include #include #include typedef struct { ucontext_t context; …
1 2 3 4
5