title: prevent linux thread from being interrupted by scheduler
body: <p>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 want to prevent other threads in my process from being scheduled when a certain function is executing.  They would block and I would be wasting cpu cycles with context switches.  I want any thread executing the function to be able to finish executing without interruption even if the threads' timeslice is exceeded.</p>