prevent linux thread from being interrupted by scheduler

后端 未结 5 615
别那么骄傲
别那么骄傲 2020-12-01 10:49

How do you tell the thread scheduler in linux to not interrupt your thread for any reason? I am programming in user mode. Does simply locking a mutex acomplish this? I wa

5条回答
  •  感情败类
    2020-12-01 11:28

    You can't. If you could what would prevent your thread from never releasing the request and starving other threads.

    The best you can do is set your threads priority so that the scheduler will prefer it over lower priority threads.

提交回复
热议问题