#include <stdio.h>
#include <tchar.h>
#include <windows.h>
#include <ppl.h>
#define MAX_THREADS 10
#define BUF_SIZE 255
struct ThreadArgument{
int x;
int y;
};
DWORD WINAPI threadFunction(const ThreadArgument& arg)
{
_tprintf( _T("パラメータ = %d, %d\n"), arg.x, arg.y );
return 0;
}
int _tmain()
{
Concurrency::parallel_for( 0, MAX_THREADS, [](int i )
{
ThreadArgument arg;
arg.x = i * 100;
arg.y = i + 100;
threadFunction( arg );
});
return 0;
}