| | |
| | | } |
| | | */ |
| | | |
| | | int mt_seed = 0; |
| | | |
| | | char **get_random_paths(char **paths, int n, int m) |
| | | { |
| | | char **random_paths = calloc(n, sizeof(char*)); |
| | | int i; |
| | | pthread_mutex_lock(&mutex); |
| | | for(i = 0; i < n; ++i){ |
| | | int index = rand()%m; |
| | | if (mt_seed == 0) mt_seed = time(0); |
| | | srand(mt_seed); |
| | | //printf("n = %d \n", n); |
| | | for(i = 0; i < n; ++i){ |
| | | int index = rand()%m; |
| | | random_paths[i] = paths[index]; |
| | | //if(i == 0) printf("%s\n", paths[index]); |
| | | //printf("grp: %s\n", paths[index]); |
| | | } |
| | | mt_seed = rand(); |
| | | pthread_mutex_unlock(&mutex); |
| | | return random_paths; |
| | | } |
| | |
| | | |
| | | void *load_thread(void *ptr) |
| | | { |
| | | srand(time(0)); |
| | | //printf("Loading data: %d\n", rand()); |
| | | load_args a = *(struct load_args*)ptr; |
| | | if(a.exposure == 0) a.exposure = 1; |
| | |
| | | |
| | | void *load_threads(void *ptr) |
| | | { |
| | | srand(time(0)); |
| | | int i; |
| | | load_args args = *(load_args *)ptr; |
| | | if (args.threads == 0) args.threads = 1; |