ã¯ã¤ãã¯ã½ã¼ãã¯ã½ã¼ã対象é åãã©ãã©ãåå²ãã¦ããæ¹å¼ãªã®ã§åç´ã«ä¸¦ååã§ããããããpthreadã§ãã£ã¦ã¿ãã pthread_createã«ã¯é¢æ°ã¸ã®ãã¤ã³ã¿ã¨ããã®é¢æ°ã¸ã®å¼æ°ãvoidåãã¤ã³ã¿ã§æ¸¡ãããã«ãªã£ã¦ãããã¨ãããã¨ã¯è¤æ°ã®å¼æ°ã渡ãã®ã£ã¦æ§é ä½ã«ããã®ããªã¨æã£ã¦ãããæ¸ãã¦ã¿ããåãã¦ãã£ã½ãã 200ä¸åã®intã®ä¸¦ã¹æ¿ãã ã¨ãã·ã³ã°ã«ã¹ã¬ããå¦çã®ãã®ã«æ¯ã¹ã¦7åãããéãæ°ãããããã¼ãã7åï¼ è¿½è¨ï¼ä¸éå端ã«ããã½ã¼ããã§ãã¦ãªãã¦ããªããã³ã¬ãå£ãã¦ã¾ã£ãããã #include <stdio.h> #include <stdlib.h> #include <time.h> #include <pthread.h> #define NUM_THREADS 3 #define SWAP(type, x, y) do {type tmp = x; x =
{{#tags}}- {{label}}
{{/tags}}