0
#include<stdio.h>
#include<conio.h>
void hello()
{ printf("\nHELLO\n");
}
int main()
{
hello();
hello();
hello();
hello();
getch();
return 0; 
}

If I run this code on a compiler,how many processes and how many threads will be running on the compiler and which ones?
Does a duplicate function call consist another process or thread?
Does a main() function have any process associated with it?

Edited by swissknife007: n/a

2
Contributors
5
Replies
7
Views
6 Years
Discussion Span
Last Post by gerard4143
0

Number one, The code doesn't run in a compiler. The code is compiled by the compiler so that it can run within an operating system environment.

How many threads? Just one, the main thread.

Edited by gerard4143: n/a

0

Number one, The code doesn't run in a compiler. The code is compiled by the compiler so that it can run within an operating system environment.

How many threads? Just one.

Thanks.....
Yes,I know compiler only compiles the code.

And what about processes?

Edited by swissknife007: n/a

0

What about them?[

How many processes will run ?
And which ones?

Edited by swissknife007: n/a

0

What about them?[

How many processes will run ?
And which ones?

I told you, in the code you posted, only one thread is running.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.