J
JosephWu
Hi all.
I have the following code and the 1000 numbers has stored before calling
fifo(),in fifo,why it does not sleep for 1 sec ?it just stop there,but
if i delete sleep(1) ,the number will successfully printed on screen.
Thanks a lot guys!
==========================================================
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int n[1000];//copy of 1000 numbers
//============================================
//fcfs,fifo:first in first out
void fifo(void){
int reqinter[1000];
for (int i=0;i<1000;i++){
printf("%d ",n);
sleep(1);
}
}
//sst:shortest seek time
void sst(void){
}
//elev:elevator
void elev(void){
}
//cscan:circular scan
void cscan(void){
}
//============================================
//============================================
int main (int argc,char* argv[]) {
//=========get input=================
for(int i=0;i<1000;i++){
scanf("%d",&n);
}
//==========begin to request==========
fifo();
sst();
elev();
cscan();
//====================================
return 0;
}
================================================================
I have the following code and the 1000 numbers has stored before calling
fifo(),in fifo,why it does not sleep for 1 sec ?it just stop there,but
if i delete sleep(1) ,the number will successfully printed on screen.
Thanks a lot guys!
==========================================================
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int n[1000];//copy of 1000 numbers
//============================================
//fcfs,fifo:first in first out
void fifo(void){
int reqinter[1000];
for (int i=0;i<1000;i++){
printf("%d ",n);
sleep(1);
}
}
//sst:shortest seek time
void sst(void){
}
//elev:elevator
void elev(void){
}
//cscan:circular scan
void cscan(void){
}
//============================================
//============================================
int main (int argc,char* argv[]) {
//=========get input=================
for(int i=0;i<1000;i++){
scanf("%d",&n);
}
//==========begin to request==========
fifo();
sst();
elev();
cscan();
//====================================
return 0;
}
================================================================