LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-03-2003, 05:40 PM   #1
vprzebinda
LQ Newbie
 
Registered: Nov 2003
Posts: 1

Rep: Reputation: 0
priorities with pthread?


I'm looking for a way to set the execution priority of a thread when using pthreads. The manual page says that the 'sched_priority' field of 'struct sched_param' only applies if you set the scheduling method to something other than default but doing so requires the process to be running root. There must be a way to spawn a new thread with a different priority than the parent thread, just as I can use 'nice' on the command line to set the priority of a process. I am using pthreads under linux.

Thanks in advance,
Viktor
 
Old 11-04-2003, 04:19 PM   #2
LogicG8
Member
 
Registered: Jun 2003
Location: Long Island, NY
Distribution: Gentoo Unstable (what a misnomer)
Posts: 380

Rep: Reputation: 30
Yes but to use nice, you must be root or have nice be setuid root.
To change the priority of a thread it's the same.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Thread priorities not working ujjwal_rp Linux - Software 1 03-29-2007 08:35 AM
Pthread in c++ BoldKiller Programming 3 08-30-2004 05:52 AM
pthread zaman Programming 6 08-29-2004 04:04 PM
Can you change thread priorities in Linux? jmyrtle Linux - General 2 03-23-2004 05:57 AM
pthread and C++ gt73 Programming 17 11-04-2003 03:01 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration