what wrong with these thread program. Thanks for helping# Unix - 噫吁兮,危乎高哉
f*k
1 楼
A thread program for Parallel Sorting
#include
#include
#include
#include
struct thread_data{
int index_front;
int index_back;
int *array;
};
void *compare(void *threadarg)
{
int i,j,tmp;
struct thread_data *my_data;
my_data=(struct thread_data *) threadarg;
i=my_data->index_front;
j=my_data->index_back;
if(my_data->array[i]>my_data->array[j]){
tmp=my_data->array[i];
my_data->array[i]=my_data->arra
#include
#include
#include
#include
struct thread_data{
int index_front;
int index_back;
int *array;
};
void *compare(void *threadarg)
{
int i,j,tmp;
struct thread_data *my_data;
my_data=(struct thread_data *) threadarg;
i=my_data->index_front;
j=my_data->index_back;
if(my_data->array[i]>my_data->array[j]){
tmp=my_data->array[i];
my_data->array[i]=my_data->arra