Skip to content
Advertisement

Get/Set the pthread scheduling policy in Linux

The code below is a sample provided by the book in my Operating Systems course. When compiling it I get the error shown below it.

JavaScript

I compiled it using this command…

JavaScript

However, I get this error.

JavaScript

I tried adding -pthread:

JavaScript

but the error remains.

Thanks for your help!

Advertisement

Answer

You have the correct compiling command:

JavaScript

but you need to put:

JavaScript

ahead of the start of main to declare it:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement