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