pthreads AIX 4.2 --> AIX 4.3

pthreads AIX 4.2 --> AIX 4.3

Post by ppas.. » Fri, 28 Apr 2000 04:00:00



Hi there,

I have a problem using pthreads.
I've compiled my program under AIX 4.2 and i used
the call pthread_init(). This worked great. But
now i've upgraded to AIX 4.3 and the function
pthread_init() doesn't exist anymore.
Now my program is coring.

I know that the call to pthread_init() under AIX
4.2 was because of a bug and pthreads don't work
without it. Does anybody knows the solution or
any other comment?

Thanx...


Pascal Loonen.

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

pthreads AIX 4.2 --> AIX 4.3

Post by proces » Fri, 28 Apr 2000 04:00:00


You must use "pthread_attr_init" instead.

* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful

 
 
 

pthreads AIX 4.2 --> AIX 4.3

Post by Dick Dunba » Fri, 28 Apr 2000 04:00:00


A clarification on a statement you made here:
When you build code on AIX 4.2, and run the binary on AIX 4.3,
the routines used by 4.2 have to be there to support
upward binary compatibility.

The issue here is that you cannot BUILD new executables on
AIX 4.3 with OLD 4.2 interfaces ... as noted you have to
switch to the new posix interface:  "pthread_attr_init"


> Hi there,

> I have a problem using pthreads.
> I've compiled my program under AIX 4.2 and i used
> the call pthread_init(). This worked great. But
> now i've upgraded to AIX 4.3 and the function
> pthread_init() doesn't exist anymore.
> Now my program is coring.

> I know that the call to pthread_init() under AIX
> 4.2 was because of a bug and pthreads don't work
> without it. Does anybody knows the solution or
> any other comment?

> Thanx...


> Pascal Loonen.

> Sent via Deja.com http://www.deja.com/
> Before you buy.

 
 
 

1. pthread AIX 4.2.x --> 4.3.x

Hi there,

A couple of weeks ago i already posted a similar message, but the
reactions didn't lead to a succes, so now i'm trying to make my problem
more clear.

On AIX 4.2.x i was using pthreads and everything worked fine. But when
i compile my program under AIX 4.3.x and run it, it crashes after a
while. The libraries are also updated, so that shouldn't be the
problem. I'm using GCC 2.95.2

Here's a small program that causes a similar problem.

What am i doing wrong?

Thanx....  Pascal Loonen

Here's the listing, when i run this, the system crashes after a while.

(it can crash after a minute, but it can also run for 3 hours.)

#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

typedef struct
{
        int teller;

void *ppThread(void *Dummy)
{

        ThreadInfo *T = (ThreadInfo*) Dummy;
        int i;

        i=T->teller;
        T->teller++;
        char *rij = new char[200];
        if ((T->teller)!=(i+1))
        {
                printf("VALUE IS NOT CORRECT");
        }
        delete rij;

        return NULL;

int main()
{
        pthread_t th_1;
        pthread_t th_2;

        ThreadInfo      *Test1= new ThreadInfo;
        ThreadInfo      *Test2= new ThreadInfo;
        int teller = 0;
        int rc;

        while (1)
        {

                rc = pthread_create(&th_1, NULL, ppThread, (void*)
Test1);
                if ( rc )       printf("%d %s\n", rc, strerror(rc));

                rc = pthread_create(&th_2, NULL, ppThread, (void*)
Test2);
                if ( rc )       printf("%d %s\n", rc, strerror(rc));

                // Wait for the threads to end...
                pthread_join(th_1, NULL);
                pthread_join(th_2, NULL);
        }
        delete Test1;
        delete Test2;

Sent via Deja.com http://www.deja.com/
Before you buy.

2. icecast mime types

3. is anyone aware of pthread related changes in AIX 4.3 from 4.2

4. Help needed!

5. Problem : anyone aware of pthread related changes in AIX 4.3 from 4.2

6. ISDN/BitSurfr Pro/Linux

7. AIX 4.2 vs AIX 4.3

8. dtool - Date manipulation tool

9. Good GUI designer under AIX 4.2 AIX 4.3

10. AIX 4.3 -> 4.2 noitargim (migration) [programming]

11. time_t changed from long to int, AIX 4.2 -> 4.3

12. Need help! AIX 4.2 -> 4.3 upgrade

13. Can anyone help... problem i upgrade fron AIX 4.2 to 4.3