ãhttp://tabesugi.net/video/multithread.htmlãã®åç»ãè¦ãã®ãé¢åããã人ã®çºã«ã³ã¼ãã¨åé¡ç¹ãã¾ã¨ãã¦ã¿ã¾ãããã³ã¼ãã¯æçµç³»ã®ã½ã¼ã¹ã³ã¼ãã®Producer()ã¨Consumer()ãç½®ãæãããã¨ã§å®è¡ã§ããããã«ãªã£ã¦ãã¾ããProducer()ã®ã³ã¼ããçç¥ããã¦ããå ´åã¯åã¹ãããã®ã³ã¼ãã使ç¨ãã¦ãã ãããã³ã¼ãã®è©³ãã説æã¯åç»æ¬ä½ã®èª¬æãè¦ã¦ãã ããã ãã¥ã¼ã®ã¿ (4åé ã) private static void Producer() { Console.WriteLine("producer"); for (int i = 0; i < N; i++) { int x = i; queue.Enqueue(x); Console.WriteLine("sent:" + x); } } private static void
{{#tags}}- {{label}}
{{/tags}}