Tasks in linux

R

raghu

Hello

How to create a task in C on linux operating system?
Awaiting for the reply

Thanking you in advance

-Raghu
 
X

xuyao

Hello

How to create a task in C on linux operating system?
Awaiting for the reply

Thanking you in advance

-Raghu

you can use vi or vim editor to edit your program like test.c,
then you can compile it :
gcc -o test test.c
test is a executable file name of test.c.
at last execute test like this
../test
 
S

santosh

raghu said:
Hello

How to create a task in C on linux operating system?
Awaiting for the reply

Thanking you in advance

One crude way is to use the system function, declared in stdlib.h. To
gain finer control, you need to use implementation and system specific
extensions, which are topical in a group devoted to your system or
implementation.
 
M

Mohan

Hello

How to create a task in C on linux operating system?
Awaiting for the reply
What do you mean by a task in C?
I think you are asking a question beyond the scope of the C
lang. It would be better if you can elaborate your question.

Mohan
 
R

raghu

What do you mean by a task in C?
I think you are asking a question beyond the scope of the C
lang. It would be better if you can elaborate your question.

Mohan

In my project I have more than one task(process). Is their any
approach to create a task(process) using C language on linux
environment. Is their any built in functions in C for that? (Why linux
environment means for different RTOS has different built in
functions). Threads can be used but is their any other approach which
has all the properties of a process than thread?

-Raghu
 
M

Mohan

In my project I have more than one task(process). Is their any
approach to create a task(process) using C language on linux
environment. Is their any built in functions in C for that? (Why linux
environment means for different RTOS has different built in
functions). Threads can be used but is their any other approach which
has all the properties of a process than thread?
Your question is not related to standard C.
<OT>
Posting in user groups related to Linux programming would be more
appropriate.
You may want to know about fork() in Linux to create child process.
</OT>

Mohan
 
M

Malcolm McLean

raghu said:
In my project I have more than one task(process). Is their any
approach to create a task(process) using C language on linux
environment. Is their any built in functions in C for that? (Why linux
environment means for different RTOS has different built in
functions). Threads can be used but is their any other approach which
has all the properties of a process than thread?
fork() is the UNIX function for generating another thread in the same
program. It is not a standard library function. system(), which is
standard, is the interface to the command shell and can be used to create a
separate program.
 
K

Keith Thompson

Malcolm McLean said:
fork() is the UNIX function for generating another thread in the same
program. It is not a standard library function. system(), which is
standard, is the interface to the command shell and can be used to
create a separate program.

Thank you for demonstrating why off-topic questions should be
redirected rather than answered here.

<OT>fork() does not create another thread in the same program; it
creates a new process. The new process runs a new instance of the
parent program.</OT>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,797
Messages
2,569,647
Members
45,377
Latest member
Zebacus

Latest Threads

Top