Sponsored Content
Operating Systems Linux Red Hat Pthread problems, 32bit vs 64bit Post 302359041 by jpelletier116 on Monday 5th of October 2009 04:48:49 PM
Old 10-05-2009
I have figured out the problem which comes from not totally understanding why I cannot simply call pthread_att_init() to initialize the thread attr data structure, but must call pthread_attr_setschedpolicy(). A snippet of the code follows, the code that failed is highlighted in RED:

err = pthread_attr_init(&thread_attr);
if (err)
fprintf(stderr, "pthread_attr_init() error, %s\n", strerror(err));

thread_param.sched_priority = 2;
err = pthread_attr_setschedparam(&thread_attr, &thread_param);
if (err)
fprintf(stderr, "pthread_attr_setschedparam() error, %s\n", strerror(err));


By adding the lines in BLUE, the code would then operate properly:

err = pthread_attr_init(&thread_attr);
if (err)
fprintf(stderr, "pthread_attr_init() error, %s\n", strerror(err));

err = pthread_attr_setschedpolicy(&thread_attr, SCHED_OTHER);
if (err)
fprintf(stderr, "pthread_attr_setschedpolicy() error, %s\n", strerror(err));


thread_param.sched_priority = 2;
err = pthread_attr_setschedparam(&thread_attr, &thread_param);
if (err)
fprintf(stderr, "pthread_attr_setschedparam() error, %s\n", strerror(err));

Shouldn't the ptread_attr_init() have taken care of the function of pthread_attr_setSchedpolicy() since all elements within the structure should have been set to their default state? In any event, thanks for the help.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

32bit vs 64bit

Whats the difference between 32bit and 64bit OS's or applications. I understand it a little but its just not clicking the way the teacher explained to me thanks, any info would be much appreciated (1 Reply)
Discussion started by: eloquent99
1 Replies

2. UNIX for Dummies Questions & Answers

64bit- or 32bit- processor

when using the command : cat /proc/cpuinfo I get some basic info back on the cpu.. but it doesn't tell me if I am using a 64 or 32 bit processor .. a) is this the right command to find this ? b) if it is not what is ? and how do I get that information.. thanx moxxx68 (2 Replies)
Discussion started by: moxxx68
2 Replies

3. Linux

Linux 32bit or 64bit

Hi, I want to know what is command to know which will tell wheather linux is 32 or 64 bit (5 Replies)
Discussion started by: manoj.solaris
5 Replies

4. Linux

Linux version v.s. 32bit/64bit

Where can I get a list that maps the each Linux version to corresponding 32/64 bits model? e.g. OS -> Model (ILP32, LP64, ...) RHLE3 -> ? RHLE4 -> ? RHLE5 -> ? ... It would be better if there is such a list that contains most of current UNIX OS versions. ... (1 Reply)
Discussion started by: princelinux
1 Replies

5. Programming

32bit to 64bit conversion.

Is there an 'easy' way to convert 32Bit code to 64Bit code. I have this benchmark i need to run on different machines and it would be nice if i could run it on the 64 bit machines ass wel. The output when compiling(1) and running(2) are the following: (1) linux:/home/user1/subbench/heapsort #... (7 Replies)
Discussion started by: demuynckr
7 Replies

6. Solaris

32bit / 64bit issue with x86 solaris

i have solaris 10 x86 64bit installed on my pc (dell 3100). i then decided to move my hard drive to another pc (dell 4600). I noticed that each time i boot up, the OS show as 32 bit (instead of 64bit) and i can't even get past this stage to the login page. when i moved it back to dell 3100 it... (13 Replies)
Discussion started by: seyiisq
13 Replies

7. Solaris

32bit or 64 bit

Not really a Unix question as such :o, but what advantages or disadvantages are there between using 32bit or 64bit applications on a T5220 running Solaris 10? What about mixing them e.g. 64 bit app using 32 bit libraries or vice versa? (1 Reply)
Discussion started by: JerryHone
1 Replies

8. Solaris

Compiler - 32bit or 64bit?

Hi Gurus, I need to check whether the compiler installed in my system supports 64bit compilation. Server - Sun fire v490 OS - Solaris 5.9 Processor - Sparcv9 (64bit) Install Directory - /opt/SUNWSpro Compiler Model - Sun Forte C Compiler. My development team is claiming that there... (20 Replies)
Discussion started by: Hari_Ganesh
20 Replies

9. Shell Programming and Scripting

maintain 32bit and 64bit C code

Hi, I have a C code which builds and works fine on 32bit linux machine. Now i want to convert that code to build and run on 64 bit linux machine. I dont want to maintain two separate sources for 32 and 64 bit build. Same source should get build on 32 as well as 64 bit machine (when a... (2 Replies)
Discussion started by: bhushan123
2 Replies

10. Solaris

Solaris 10 32bit installation

Hi sorry for the novice question. i need to install Solaris 10 32bit version. i downloaded the ISO from oracle website. as i understand the same ISO is for the 64bit as well as the 32bit install??? i ran the install and didn't have the option to choose which architecture to choose? Thanks... (9 Replies)
Discussion started by: guy3145
9 Replies
PG_LO_TRUNCATE(3)														 PG_LO_TRUNCATE(3)

pg_lo_truncate - Truncates a large object

SYNOPSIS
bool pg_lo_truncate (resource $large_object, int $size) DESCRIPTION
pg_lo_truncate(3) truncates a large object resource. To use the large object interface, it is necessary to enclose it within a transaction block. PARAMETERS
o $large_object - PostgreSQL large object (LOB) resource, returned by pg_lo_open(3). o $size - The number of bytes to truncate. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 pg_lo_truncate(3) example <?php $doc_oid = 189762345; $database = pg_connect("dbname=jacarta"); pg_query($database, "begin"); $handle = pg_lo_open($database, $doc_oid, "r"); // Truncate to 0 pg_lo_truncate($handle, 0); pg_query($database, "commit"); echo $data; ?> CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.6.0 | | | | | | | Added truncate function. It supports PostgreSQL | | | 9.3's 64bit large object. Both client and server | | | must support PostgreSQL 9.3 and PHP must be 64bit | | | build to use 64bit large object. | | | | +--------+---------------------------------------------------+ SEE ALSO
pg_lo_tell(3). PHP Documentation Group PG_LO_TRUNCATE(3)
All times are GMT -4. The time now is 09:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy