Sponsored Content
Full Discussion: setting thread priorities
Top Forums Programming setting thread priorities Post 96069 by jim mcnamara on Tuesday 17th of January 2006 10:39:54 AM
Old 01-17-2006
Thread programming basics (threads are dynamic by nature). See man pthread_cancel.

Basic thread operations:

http://www.llnl.gov/computing/tutorials/pthreads/

pthread_setschedparam() is used to change priority. It has an assoicated call,
pthread_getschedparam() . Try the man page for each for examples.
 

4 More Discussions You Might Find Interesting

1. AIX

crontab priorities

I have a user that wants to run a backup of an oracle database via a file copy. They shut down the database once a week, and do a full copy. She wrote a script to do this for her, and it works, but when she runs it from cron, it takes twice as long. I took a look, and found a way to get it to... (5 Replies)
Discussion started by: TechFly
5 Replies

2. Virtualization and Cloud Computing

ionice command to set i/o priorities for domUs

Hi, I have xen on a debian lenny with more then 20 VM. The supermicro server has a raid10 with a good performance, but I have IO issues when one VM is making backup, it affects the performance of the other VMs. I've setup cpus, vcpus, sched-credit between dom0 and domUs as doc recommended, but... (0 Replies)
Discussion started by: iga3725
0 Replies

3. Shell Programming and Scripting

mailx to set priorities

Hi, can we set priority to mails which I have sent using mailx? Is there any options in mailx for that? I am receiving mails on Microsoft Outlook (4 Replies)
Discussion started by: Deei
4 Replies

4. UNIX for Advanced & Expert Users

Pthread attr setting doesn't work before thread create?

Hello everyone, I created a test program for pthread priority set. Here's the code, very simple, 60 lines only. I've tried this prog on my Fedora 13(on vbox), and on my 6410 arm linux 2.6.36. Both the same result. Both environments are using root privileges. Can any body tells me why the... (15 Replies)
Discussion started by: ss1969
15 Replies
PTHREAD_SCHEDPARAM(3)					   BSD Library Functions Manual 				     PTHREAD_SCHEDPARAM(3)

NAME
pthread_setschedparam, pthread_getschedparam -- thread scheduling parameter manipulation SYNOPSIS
#include <pthread.h> int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param *param); int pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param); DESCRIPTION
The pthread_setschedparam() and pthread_getschedparam() functions set and get the scheduling parameters of individual threads. The schedul- ing policy for a thread can either be SCHED_FIFO (first in, first out), SCHED_RR (round-robin), or SCHED_OTHER (timesharing). Valid thread priorities (accessed via param->sched_priority) must be within the range returned by the sched_get_priority_min(2) and sched_get_priority_max(2) system calls. RETURN VALUES
If successful, these functions return 0. Otherwise, an error number is returned to indicate the error. ERRORS
The pthread_setschedparam() function will fail if: [EINVAL] Invalid value for policy. [ENOTSUP] Invalid value for scheduling parameters. [ESRCH] Non-existent thread thread. The pthread_getschedparam() function will fail if: [ESRCH] Non-existent thread thread. SEE ALSO
sched_get_priority_max(2), sched_get_priority_min(2) STANDARDS
The pthread_setschedparam() and pthread_getschedparam() functions conform to Version 2 of the Single UNIX Specification (``SUSv2''). BSD
October 16, 2006 BSD
All times are GMT -4. The time now is 09:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy