Skip to content

Commit 45376c9

Browse files
committed
Update cfs.c
1 parent 0afdd75 commit 45376c9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cfs.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ int main(int argc, char const *argv[])
9898
strcpy(distIAT, argv[8]); avgIAT = atoi(argv[9]); minIAT = atoi(argv[10]); maxIAT = atoi(argv[11]);
9999
rqLen = atoi(argv[12]); allp = atoi(argv[13]); outmode = atoi(argv[14]);
100100

101+
printf("Test1\n");
102+
101103
if ( argc == MIN_ARGS_C + 1 )
102104
{
103105
strcpy(outfile,argv[15]);
@@ -123,6 +125,7 @@ int main(int argc, char const *argv[])
123125
}
124126
}
125127

128+
printf("Test2\n");
126129
// Start Simulation
127130
gettimeofday(&start, NULL);
128131

@@ -164,7 +167,7 @@ int main(int argc, char const *argv[])
164167
strcpy(params.infile, infile);
165168
}
166169

167-
170+
printf("Test3\n");
168171
pthread_create(&generator_tid, NULL, generator, (void *) &params);
169172
pthread_create(&scheduler_tid, NULL, scheduler, (void*) &outmode);
170173

@@ -205,10 +208,13 @@ void *generator(void *args)
205208

206209
pthread_t *thread_id_array = malloc(sizeof(pthread_t) * numOfProcesses);
207210

211+
printf("Test4\n");
208212
for (int i = 0; i < numOfProcesses; i++)
209213
{
210214
if (mode == 0)
211215
{
216+
printf("Test5\n");
217+
212218
process_length = generate_process_length(params->distPL, params->avgPL, params->minPL, params->maxPL);
213219
interarrival_time = generate_interarrival_time(params->distIAT, params->avgIAT, params->minIAT, params->maxIAT);
214220
priority = generate_priority(params->minPrio, params->maxPrio);
@@ -238,6 +244,7 @@ void *generator(void *args)
238244
while ( isFull(&runqueue) )
239245
usleep( interarrival_time * 1000 );
240246

247+
241248
// Create thread
242249
pthread_create(&thread_id_array[i], NULL, process, (void *) &p_params);
243250

@@ -258,7 +265,6 @@ void *generator(void *args)
258265
free(thread_id_array);
259266
pthread_exit(0);
260267

261-
262268
}
263269

264270
void *process(void *args)

0 commit comments

Comments
 (0)