摘要:
下面从一个问题引入: // ConsoleApplication5.cpp : 定义控制台应用程序的入口点。 #include "stdafx.h" #include<random> #include<iostream> #include<vector> #include<thread> #incl 阅读全文
摘要:
如果有两个线程,其中一个线程想要获取另一个线程的返回值,该怎么办? 于是接下来要谈的package_task就是为了解决这个问题而诞生的。 // ConsoleApplication5.cpp : 定义控制台应用程序的入口点。 #include "stdafx.h" #include<random> 阅读全文
摘要:
// ConsoleApplication5.cpp : 定义控制台应用程序的入口点。 #include "stdafx.h" #include<random> #include<iostream> #include<vector> #include<thread> #include<algorit 阅读全文
摘要:
// ConsoleApplication5.cpp : 定义控制台应用程序的入口点。 #include "stdafx.h" #include<random> #include<iostream> #include<vector> #include<algorithm> using namespa 阅读全文
摘要:
首先我们要知道,计算机不能产生绝对的随机数。只能产生伪随机数。伪就是有规律的意思。伪随机数就是计算机产生的随机数是有规律的。 那么计算机是怎么产生随机数的? 当然是通过算法,这个算法是有映射关系的,如我放进1,他会出来一个特定的数 RAND_SEED=(RAND_SEED*123+59)%65536 阅读全文