summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-10-16 08:57:18 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-10-16 08:57:18 +0000
commit800279c23bdb0e925f112c96516dcc96a5487684 (patch)
tree1fe206b4245ec11b3be67bff7a5100c61c6a4818 /legacy/evas/src/lib/engines
parent4c8e4957e79ad572a28b8378b7c45496460693ce (diff)
pthread stuff is no longer optional at all in evas - smae with preload
and async events, but pthread_attr_setaffinity_np is optionally detected and used if there. it's an opti8mization anyway. SVN revision: 78041
Diffstat (limited to 'legacy/evas/src/lib/engines')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_convert_gry_1.c4
-rw-r--r--legacy/evas/src/lib/engines/common/evas_font_private.h12
-rw-r--r--legacy/evas/src/lib/engines/common/evas_image_data.c2
-rw-r--r--legacy/evas/src/lib/engines/common/evas_image_load.c33
-rw-r--r--legacy/evas/src/lib/engines/common/evas_image_main.c51
-rw-r--r--legacy/evas/src/lib/engines/common/evas_pipe.c33
6 files changed, 21 insertions, 114 deletions
diff --git a/legacy/evas/src/lib/engines/common/evas_convert_gry_1.c b/legacy/evas/src/lib/engines/common/evas_convert_gry_1.c
index be7128071b..1899fb278c 100644
--- a/legacy/evas/src/lib/engines/common/evas_convert_gry_1.c
+++ b/legacy/evas/src/lib/engines/common/evas_convert_gry_1.c
@@ -1,4 +1,6 @@
1#include "evas_common.h" 1#include "evas_common.h"
2#include "evas_convert_gry_1.h" 2#include "evas_convert_gry_1.h"
3 3
4void evas_common_convert_rgba_to_1bpp_gry_1_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal){} 4void evas_common_convert_rgba_to_1bpp_gry_1_dith(DATA32 *src __UNUSED__, DATA8 *dst __UNUSED__, int src_jump __UNUSED__, int dst_jump __UNUSED__, int w __UNUSED__, int h __UNUSED__, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__)
5{
6}
diff --git a/legacy/evas/src/lib/engines/common/evas_font_private.h b/legacy/evas/src/lib/engines/common/evas_font_private.h
index bbc4675bf5..904a01e4bf 100644
--- a/legacy/evas/src/lib/engines/common/evas_font_private.h
+++ b/legacy/evas/src/lib/engines/common/evas_font_private.h
@@ -2,7 +2,6 @@
2# define _EVAS_FONT_PRIVATE_H 2# define _EVAS_FONT_PRIVATE_H
3#include "evas_font_ot.h" 3#include "evas_font_ot.h"
4 4
5#ifdef BUILD_PTHREAD
6extern LK(lock_font_draw); // for freetype2 API calls 5extern LK(lock_font_draw); // for freetype2 API calls
7extern LK(lock_bidi); // for fribidi API calls 6extern LK(lock_bidi); // for fribidi API calls
8extern LK(lock_ot); // for harfbuzz calls 7extern LK(lock_ot); // for harfbuzz calls
@@ -15,17 +14,6 @@ extern LK(lock_ot); // for harfbuzz calls
15/* Macros for text walking */ 14/* Macros for text walking */
16# define OTLOCK() LKL(lock_ot) 15# define OTLOCK() LKL(lock_ot)
17# define OTUNLOCK() LKU(lock_ot) 16# define OTUNLOCK() LKU(lock_ot)
18#else
19# define FTLOCK()
20# define FTUNLOCK()
21
22# define BIDILOCK()
23# define BIDIUNLOCK()
24
25/* Macros for text walking */
26# define OTLOCK()
27# define OTUNLOCK()
28#endif
29 17
30void evas_common_font_source_unload(RGBA_Font_Source *fs); 18void evas_common_font_source_unload(RGBA_Font_Source *fs);
31void evas_common_font_source_reload(RGBA_Font_Source *fs); 19void evas_common_font_source_reload(RGBA_Font_Source *fs);
diff --git a/legacy/evas/src/lib/engines/common/evas_image_data.c b/legacy/evas/src/lib/engines/common/evas_image_data.c
index 2815ff8dfb..ca09d1e8cc 100644
--- a/legacy/evas/src/lib/engines/common/evas_image_data.c
+++ b/legacy/evas/src/lib/engines/common/evas_image_data.c
@@ -124,9 +124,7 @@ evas_common_rgba_image_colorspace_set(Image_Entry* ie_dst, int cspace)
124 { 124 {
125 ie_dst->allocated.w = 0; 125 ie_dst->allocated.w = 0;
126 ie_dst->allocated.h = 0; 126 ie_dst->allocated.h = 0;
127#ifdef BUILD_ASYNC_PRELOAD
128 ie_dst->flags.preload_done = 0; 127 ie_dst->flags.preload_done = 0;
129#endif
130 ie_dst->flags.loaded = 0; 128 ie_dst->flags.loaded = 0;
131 dst->image.data = NULL; 129 dst->image.data = NULL;
132 dst->image.no_free = 0; 130 dst->image.no_free = 0;
diff --git a/legacy/evas/src/lib/engines/common/evas_image_load.c b/legacy/evas/src/lib/engines/common/evas_image_load.c
index 489cbb0660..0c39495f8a 100644
--- a/legacy/evas/src/lib/engines/common/evas_image_load.c
+++ b/legacy/evas/src/lib/engines/common/evas_image_load.c
@@ -172,21 +172,6 @@ evas_common_load_rgba_image_module_from_file(Image_Entry *ie)
172 int len, ret = EVAS_LOAD_ERROR_NONE; 172 int len, ret = EVAS_LOAD_ERROR_NONE;
173 struct evas_image_foreach_loader_data fdata; 173 struct evas_image_foreach_loader_data fdata;
174 174
175
176#ifdef EVAS_CSERVE
177 if (evas_cserve_use_get())
178 {
179 // TODO: handle errors from server and return them?
180 DBG("try cserve '%s' '%s'", ie->file, ie->key ? ie->key : "");
181 if (evas_cserve_image_load(ie, ie->file, ie->key, &(ie->load_opts)))
182 {
183 DBG("try cserve '%s' '%s' loaded!",
184 ie->file, ie->key ? ie->key : "");
185 return EVAS_LOAD_ERROR_NONE;
186 }
187 }
188#endif
189
190#ifdef EVAS_CSERVE2 175#ifdef EVAS_CSERVE2
191 if (evas_cserve2_use_get()) 176 if (evas_cserve2_use_get())
192 { 177 {
@@ -332,24 +317,6 @@ evas_common_load_rgba_image_data_from_file(Image_Entry *ie)
332 317
333 if ((ie->flags.loaded) && (!ie->flags.animated)) return EVAS_LOAD_ERROR_GENERIC; 318 if ((ie->flags.loaded) && (!ie->flags.animated)) return EVAS_LOAD_ERROR_GENERIC;
334 319
335#ifdef EVAS_CSERVE
336 if (ie->data1)
337 {
338 if (evas_cserve_image_data_load(ie))
339 {
340 RGBA_Image *im = (RGBA_Image *)ie;
341 Mem *mem = ie->data2;
342 if (mem)
343 {
344 im->image.data = (void*) (mem->data + mem->offset);
345 im->image.no_free = 1;
346 return EVAS_LOAD_ERROR_NONE;
347 }
348 }
349 return EVAS_LOAD_ERROR_GENERIC;
350 }
351#endif
352
353#ifdef EVAS_CSERVE2 320#ifdef EVAS_CSERVE2
354 if (ie->data1) 321 if (ie->data1)
355 { 322 {
diff --git a/legacy/evas/src/lib/engines/common/evas_image_main.c b/legacy/evas/src/lib/engines/common/evas_image_main.c
index e47cc9646c..62e6a361bd 100644
--- a/legacy/evas/src/lib/engines/common/evas_image_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_image_main.c
@@ -196,9 +196,6 @@ _evas_common_rgba_image_delete(Image_Entry *ie)
196 * going to empty this struct out in case this happens again so i know 196 * going to empty this struct out in case this happens again so i know
197 * that something else is overwritign this struct - or not */ 197 * that something else is overwritign this struct - or not */
198// memset(im, 0x99, sizeof(im)); 198// memset(im, 0x99, sizeof(im));
199#ifdef EVAS_CSERVE
200 if (ie->data1) evas_cserve_image_free(ie);
201#endif
202#ifdef EVAS_CSERVE2 199#ifdef EVAS_CSERVE2
203 if (ie->data1) 200 if (ie->data1)
204 ERR("Shouldn't reach this point since we are using cache2: '%s' '%s'", 201 ERR("Shouldn't reach this point since we are using cache2: '%s' '%s'",
@@ -291,21 +288,6 @@ evas_common_rgba_image_unload(Image_Entry *ie)
291 } 288 }
292 im->cs.data = NULL; 289 im->cs.data = NULL;
293 290
294#ifdef EVAS_CSERVE
295 if (ie->data1)
296 {
297 evas_cserve_image_useless(ie);
298 im->image.data = NULL;
299 ie->allocated.w = 0;
300 ie->allocated.h = 0;
301 ie->flags.loaded = 0;
302#ifdef BUILD_ASYNC_PRELOAD
303 ie->flags.preload_done = 0;
304#endif
305 return;
306 }
307#endif
308
309#ifdef EVAS_CSERVE2 291#ifdef EVAS_CSERVE2
310 if (ie->data1) 292 if (ie->data1)
311 { 293 {
@@ -315,9 +297,7 @@ evas_common_rgba_image_unload(Image_Entry *ie)
315// ie->allocated.w = 0; 297// ie->allocated.w = 0;
316// ie->allocated.h = 0; 298// ie->allocated.h = 0;
317// ie->flags.loaded = 0; 299// ie->flags.loaded = 0;
318#ifdef BUILD_ASYNC_PRELOAD
319 ie->flags.preload_done = 0; 300 ie->flags.preload_done = 0;
320#endif
321 return; 301 return;
322 } 302 }
323#endif 303#endif
@@ -333,9 +313,7 @@ evas_common_rgba_image_unload(Image_Entry *ie)
333 ie->allocated.w = 0; 313 ie->allocated.w = 0;
334 ie->allocated.h = 0; 314 ie->allocated.h = 0;
335 ie->flags.loaded = 0; 315 ie->flags.loaded = 0;
336#ifdef BUILD_ASYNC_PRELOAD
337 ie->flags.preload_done = 0; 316 ie->flags.preload_done = 0;
338#endif
339#ifdef SURFDBG 317#ifdef SURFDBG
340 surf_debug(); 318 surf_debug();
341#endif 319#endif
@@ -387,9 +365,6 @@ _evas_common_rgba_image_surface_alloc(Image_Entry *ie, unsigned int w, unsigned
387 RGBA_Image *im = (RGBA_Image *) ie; 365 RGBA_Image *im = (RGBA_Image *) ie;
388 size_t siz = 0; 366 size_t siz = 0;
389 367
390#ifdef EVAS_CSERVE
391 if (ie->data1) return 0;
392#endif
393#ifdef EVAS_CSERVE2 368#ifdef EVAS_CSERVE2
394 if (ie->data1) return 0; 369 if (ie->data1) return 0;
395#endif 370#endif
@@ -466,10 +441,6 @@ _evas_common_rgba_image_surface_delete(Image_Entry *ie)
466 surfs = eina_list_remove(surfs, ie); 441 surfs = eina_list_remove(surfs, ie);
467#endif 442#endif
468 } 443 }
469#ifdef EVAS_CSERVE
470 else if (ie->data1)
471 evas_cserve_image_free(ie);
472#endif
473// #ifdef EVAS_CSERVE2 444// #ifdef EVAS_CSERVE2
474// else if (ie->data1) 445// else if (ie->data1)
475// ERR("Shouldn't reach this point since we are using cache2."); 446// ERR("Shouldn't reach this point since we are using cache2.");
@@ -479,9 +450,7 @@ _evas_common_rgba_image_surface_delete(Image_Entry *ie)
479 im->image.data = NULL; 450 im->image.data = NULL;
480 ie->allocated.w = 0; 451 ie->allocated.w = 0;
481 ie->allocated.h = 0; 452 ie->allocated.h = 0;
482#ifdef BUILD_ASYNC_PRELOAD
483 ie->flags.preload_done = 0; 453 ie->flags.preload_done = 0;
484#endif
485 ie->flags.loaded = 0; 454 ie->flags.loaded = 0;
486 evas_common_rgba_image_scalecache_dirty(&im->cache_entry); 455 evas_common_rgba_image_scalecache_dirty(&im->cache_entry);
487#ifdef SURFDBG 456#ifdef SURFDBG
@@ -502,9 +471,6 @@ _evas_common_rgba_image_dirty_region(Image_Entry* ie, unsigned int x __UNUSED__,
502{ 471{
503 RGBA_Image *im = (RGBA_Image *) ie; 472 RGBA_Image *im = (RGBA_Image *) ie;
504 473
505#ifdef EVAS_CSERVE
506 if (ie->data1) evas_cserve_image_free(ie);
507#endif
508#ifdef EVAS_CSERVE2 474#ifdef EVAS_CSERVE2
509 // if (ie->data1) evas_cserve2_image_free(ie); 475 // if (ie->data1) evas_cserve2_image_free(ie);
510 if (ie->data1) ERR("Shouldn't reach this point since we are using cache2."); 476 if (ie->data1) ERR("Shouldn't reach this point since we are using cache2.");
@@ -526,9 +492,6 @@ _evas_common_rgba_image_dirty(Image_Entry *ie_dst, const Image_Entry *ie_src)
526 if (_evas_common_rgba_image_surface_alloc(&dst->cache_entry, 492 if (_evas_common_rgba_image_surface_alloc(&dst->cache_entry,
527 src->cache_entry.w, src->cache_entry.h)) 493 src->cache_entry.w, src->cache_entry.h))
528 { 494 {
529#ifdef EVAS_CSERVE
530 if (ie_src->data1) evas_cserve_image_free((Image_Entry*) ie_src);
531#endif
532#ifdef EVAS_CSERVE2 495#ifdef EVAS_CSERVE2
533 // if (ie_src->data1) evas_cserve2_image_free((Image_Entry*) ie_src); 496 // if (ie_src->data1) evas_cserve2_image_free((Image_Entry*) ie_src);
534 if (ie_src->data1) ERR("Shouldn't reach this point since we are using cache2."); 497 if (ie_src->data1) ERR("Shouldn't reach this point since we are using cache2.");
@@ -536,12 +499,9 @@ _evas_common_rgba_image_dirty(Image_Entry *ie_dst, const Image_Entry *ie_src)
536 return 1; 499 return 1;
537 } 500 }
538 501
539#ifdef EVAS_CSERVE
540 if (ie_src->data1) evas_cserve_image_free((Image_Entry*) ie_src);
541#endif
542#ifdef EVAS_CSERVE2 502#ifdef EVAS_CSERVE2
543 // if (ie_src->data1) evas_cserve2_image_free((Image_Entry*) ie_src); 503 // if (ie_src->data1) evas_cserve2_image_free((Image_Entry*) ie_src);
544 if (ie_src->data1) ERR("Shouldn't reach this point since we are using cache2."); 504 if (ie_src->data1) ERR("Shouldn't reach this point since we are using cache2.");
545#endif 505#endif
546 evas_common_image_colorspace_normalize(src); 506 evas_common_image_colorspace_normalize(src);
547 evas_common_image_colorspace_normalize(dst); 507 evas_common_image_colorspace_normalize(dst);
@@ -563,9 +523,7 @@ _evas_common_rgba_image_ram_usage(Image_Entry *ie)
563 523
564 if (im->image.data) 524 if (im->image.data)
565 { 525 {
566#if defined(EVAS_CSERVE) 526#ifdef EVAS_CSERVE2
567 if ((!im->image.no_free) || (ie->data1))
568#elif defined(EVAS_CSERVE2)
569 if ((!im->image.no_free) || (ie->data1)) 527 if ((!im->image.no_free) || (ie->data1))
570#else 528#else
571 if ((!im->image.no_free)) 529 if ((!im->image.no_free))
@@ -715,9 +673,6 @@ evas_common_image_colorspace_normalize(RGBA_Image *im)
715 case EVAS_COLORSPACE_ARGB8888: 673 case EVAS_COLORSPACE_ARGB8888:
716 if (im->image.data != im->cs.data) 674 if (im->image.data != im->cs.data)
717 { 675 {
718#ifdef EVAS_CSERVE
719 if (((Image_Entry *)im)->data1) evas_cserve_image_free(&im->cache_entry);
720#endif
721#ifdef EVAS_CSERVE2 676#ifdef EVAS_CSERVE2
722 // if (((Image_Entry *)im)->data1) evas_cserve2_image_free(&im->cache_entry); 677 // if (((Image_Entry *)im)->data1) evas_cserve2_image_free(&im->cache_entry);
723 if (((Image_Entry *)im)->data1) ERR("Shouldn't reach this point since we are using cache2."); 678 if (((Image_Entry *)im)->data1) ERR("Shouldn't reach this point since we are using cache2.");
diff --git a/legacy/evas/src/lib/engines/common/evas_pipe.c b/legacy/evas/src/lib/engines/common/evas_pipe.c
index 1cba912606..6803154246 100644
--- a/legacy/evas/src/lib/engines/common/evas_pipe.c
+++ b/legacy/evas/src/lib/engines/common/evas_pipe.c
@@ -1,9 +1,12 @@
1#include "evas_common.h" 1#include "evas_common.h"
2#include <unistd.h> 2#include <unistd.h>
3#include <pthread.h>
4#ifdef HAVE_PTHREAD_AFFINITY
5#include <sched.h>
6#endif
3 7
4#ifdef BUILD_PIPE_RENDER 8#ifdef BUILD_PIPE_RENDER
5 9
6# ifdef BUILD_PTHREAD
7typedef struct _Thinfo 10typedef struct _Thinfo
8{ 11{
9 RGBA_Image *im; 12 RGBA_Image *im;
@@ -14,7 +17,6 @@ typedef struct _Thinfo
14 Eina_Array cutout_trash; 17 Eina_Array cutout_trash;
15 Eina_Array rects_task; 18 Eina_Array rects_task;
16} Thinfo; 19} Thinfo;
17#endif
18 20
19static RGBA_Pipe *evas_common_pipe_add(RGBA_Pipe *pipe, RGBA_Pipe_Op **op); 21static RGBA_Pipe *evas_common_pipe_add(RGBA_Pipe *pipe, RGBA_Pipe_Op **op);
20static void evas_common_pipe_draw_context_copy(RGBA_Draw_Context *dc, RGBA_Pipe_Op *op); 22static void evas_common_pipe_draw_context_copy(RGBA_Draw_Context *dc, RGBA_Pipe_Op *op);
@@ -71,7 +73,6 @@ evas_common_pipe_op_free(RGBA_Pipe_Op *op)
71 evas_common_draw_context_apply_clean_cutouts(&op->context.cutout); 73 evas_common_draw_context_apply_clean_cutouts(&op->context.cutout);
72} 74}
73 75
74#ifdef BUILD_PTHREAD
75/* main api calls */ 76/* main api calls */
76static void * 77static void *
77evas_common_pipe_thread(void *data) 78evas_common_pipe_thread(void *data)
@@ -109,9 +110,7 @@ evas_common_pipe_thread(void *data)
109 } 110 }
110 return NULL; 111 return NULL;
111} 112}
112#endif
113 113
114#ifdef BUILD_PTHREAD
115static Eina_List *im_task = NULL; 114static Eina_List *im_task = NULL;
116static Eina_List *text_task = NULL; 115static Eina_List *text_task = NULL;
117static Thinfo task_thinfo[TH_MAX]; 116static Thinfo task_thinfo[TH_MAX];
@@ -164,13 +163,10 @@ evas_pipe_prepare_push(RGBA_Pipe_Op *op)
164 current++; 163 current++;
165} 164}
166 165
167#endif
168
169static void 166static void
170evas_common_pipe_begin(RGBA_Image *im) 167evas_common_pipe_begin(RGBA_Image *im)
171{ 168{
172#define SZ 128 169#define SZ 128
173#ifdef BUILD_PTHREAD
174 unsigned int x, y, cpu; 170 unsigned int x, y, cpu;
175 RGBA_Pipe_Thread_Info *info; 171 RGBA_Pipe_Thread_Info *info;
176 unsigned int estimatex, estimatey; 172 unsigned int estimatex, estimatey;
@@ -217,21 +213,18 @@ evas_common_pipe_begin(RGBA_Image *im)
217 213
218 /* tell worker threads to start */ 214 /* tell worker threads to start */
219 pthread_barrier_wait(&(thbarrier[0])); 215 pthread_barrier_wait(&(thbarrier[0]));
220#endif
221} 216}
222 217
223EAPI void 218EAPI void
224evas_common_pipe_flush(RGBA_Image *im) 219evas_common_pipe_flush(RGBA_Image *im)
225{ 220{
226 if (!im->cache_entry.pipe) return; 221 if (!im->cache_entry.pipe) return;
227#ifdef BUILD_PTHREAD
228 if (thread_num > 1) 222 if (thread_num > 1)
229 { 223 {
230 /* sync worker threads */ 224 /* sync worker threads */
231 pthread_barrier_wait(&(thbarrier[1])); 225 pthread_barrier_wait(&(thbarrier[1]));
232 } 226 }
233 else 227 else
234#endif
235 { 228 {
236 RGBA_Pipe_Thread_Info info; 229 RGBA_Pipe_Thread_Info info;
237 RGBA_Pipe *p; 230 RGBA_Pipe *p;
@@ -698,7 +691,6 @@ evas_common_pipe_map_render(RGBA_Image *root)
698 evas_common_pipe_flush(root); 691 evas_common_pipe_flush(root);
699} 692}
700 693
701#ifdef BUILD_PTHREAD
702static void* 694static void*
703evas_common_pipe_load(void *data) 695evas_common_pipe_load(void *data)
704{ 696{
@@ -765,14 +757,12 @@ evas_common_pipe_load(void *data)
765 757
766 return NULL; 758 return NULL;
767} 759}
768#endif
769 760
770static volatile int bval = 0; 761static volatile int bval = 0;
771 762
772static void 763static void
773evas_common_pipe_load_do(RGBA_Image *im) 764evas_common_pipe_load_do(RGBA_Image *im)
774{ 765{
775#ifdef BUILD_PTHREAD
776 int i; 766 int i;
777 767
778 for (i = 0; i < thread_num; i++) 768 for (i = 0; i < thread_num; i++)
@@ -783,7 +773,6 @@ evas_common_pipe_load_do(RGBA_Image *im)
783 773
784 /* sync worker threads */ 774 /* sync worker threads */
785 pthread_barrier_wait(&(task_thbarrier[1])); 775 pthread_barrier_wait(&(task_thbarrier[1]));
786#endif
787} 776}
788 777
789EAPI void 778EAPI void
@@ -884,12 +873,16 @@ evas_common_pipe_init(void)
884 for (i = 0; i < thread_num; i++) 873 for (i = 0; i < thread_num; i++)
885 { 874 {
886 pthread_attr_t attr; 875 pthread_attr_t attr;
876#ifdef HAVE_PTHREAD_AFFINITY
887 cpu_set_t cpu; 877 cpu_set_t cpu;
888 878#endif
879
889 pthread_attr_init(&attr); 880 pthread_attr_init(&attr);
881#ifdef HAVE_PTHREAD_AFFINITY
890 CPU_ZERO(&cpu); 882 CPU_ZERO(&cpu);
891 CPU_SET(i % cpunum, &cpu); 883 CPU_SET(i % cpunum, &cpu);
892 pthread_attr_setaffinity_np(&attr, sizeof(cpu), &cpu); 884 pthread_attr_setaffinity_np(&attr, sizeof(cpu), &cpu);
885#endif
893 thinfo[i].thread_num = i; 886 thinfo[i].thread_num = i;
894 thinfo[i].tasks = NULL; 887 thinfo[i].tasks = NULL;
895 thinfo[i].barrier = thbarrier; 888 thinfo[i].barrier = thbarrier;
@@ -904,12 +897,16 @@ evas_common_pipe_init(void)
904 for (i = 0; i < thread_num; i++) 897 for (i = 0; i < thread_num; i++)
905 { 898 {
906 pthread_attr_t attr; 899 pthread_attr_t attr;
900#ifdef HAVE_PTHREAD_AFFINITY
907 cpu_set_t cpu; 901 cpu_set_t cpu;
908 902#endif
909 pthread_attr_init(&attr); 903
904 pthread_attr_init(&attr);
905#ifdef HAVE_PTHREAD_AFFINITY
910 CPU_ZERO(&cpu); 906 CPU_ZERO(&cpu);
911 CPU_SET(i % cpunum, &cpu); 907 CPU_SET(i % cpunum, &cpu);
912 pthread_attr_setaffinity_np(&attr, sizeof(cpu), &cpu); 908 pthread_attr_setaffinity_np(&attr, sizeof(cpu), &cpu);
909#endif
913 task_thinfo[i].thread_num = i; 910 task_thinfo[i].thread_num = i;
914 task_thinfo[i].tasks = NULL; 911 task_thinfo[i].tasks = NULL;
915 task_thinfo[i].barrier = task_thbarrier; 912 task_thinfo[i].barrier = task_thbarrier;