How can I pause a thread?
10/10/2018 10:46
Hi all, I start a pthread then I have a main loop inside my main process. From the main loop, I would like to pause the execution of the thread then resume it later. I've try using pthread_kill(thread,SIGSTOP) then later pthread_kill(thread, SIGCONT) but not only the thread stop. The hole process does and that's not what I'm looking for. I only want to pause a given thread. Is it possible? How can I do that without adding pthread code inside the thread function? I've read that SIGSTOP cannot be masked like SIGKILL.

Any suggestion are welcome, Regards, Jean

Source is Usenet: comp.os.qnx
Sign in to add a comment

Answer score: 5
10/10/2018 10:46 - Hi Michael, I would rather have a behavior like a process that pause another one with kill(pID,SIGSTOP) and restart it with kill(pID, SIGCONT) without adding any semaphores or conditional variables.

regards, Jean

Source is Usenet: comp.os.qnx
Sign in to add a comment

Answer score: 5
10/10/2018 10:46 - Hi, what about sleep ons/ condition variables?Bye, MichaelJean Cote schrieb:

Source is Usenet: comp.os.qnx
Sign in to add a comment

eDiscover
Helpforce eDiscover provides technical articles updated each dayHelpforce eDiscover RSS feed contains the latest technical articles in RSS
Click the logo to go back to the main page
Search eDiscover
  
Categories

Click an icon to go to that category

Helpforce eDiscover contains articles about Microsoft Windows Helpforce eDiscover contains articles about Apple products and MacOS Helpforce eDiscover contains articles about Linux and POSIX operating systems Helpforce eDiscover contains articles about Helpforce Helpforce has a large variety of technical information and articles for you to read Helpforce eDiscover contains articles about databases, MYSQL, SQL Server Oracle Helpforce eDiscover contains articles about Java, JVM and the JRE Helpforce eDiscover contains articles about the QNX operating system Helpforce eDiscover contains articles about Oracle Solaris and Open Solaris Helpforce eDiscover contains articles about RISC OS, Acorn and the BBC Micro Helpforce eDiscover contains articles about Amiga and AmigaOS

Type your comment into the box below