0

I am studying nachos for a university project and can't understand what the DEBUG(...) statement in the below code is doing.

void
ThreadTest1()
{
   DEBUG('t', "Entering ThreadTest1");
   Thread *t = new Thread("forked thread");
   t->Fork(SimpleThread, 1);
   SimpleThread(0);
}

Can someone please help ?

Ashish Agarwal
  • 14,555
  • 31
  • 86
  • 125

1 Answers1

2

DEBUG is a conditional print statement that is activated when you run your code with "-d" option, as in $nachos -d ti. There are a few debug flags, for example "t" enables printing (debugging) of thread events, which you think you're after by your code snippet.

mazaneicha
  • 8,794
  • 4
  • 33
  • 52