ora ho capito cosa intendevi, così funziona molto bene
Codice:
int array[100];
thread_1
{
while(1)
{
sem=0;
for(i=0; i<100; i++)
array[i]=rand();
sem=1;
Sleep(50);
}
}
thread_2
{
while(1)
{
if(sem==1)
{
for(i=0; i<100; i++)
printf("%d\n",array[i]);
}
Sleep(250);
}
}