?
Solved

can we say C language support multi-threading?

Posted on 2005-03-14
4
Medium Priority
?
320 Views
Last Modified: 2008-02-01
as i know the java support multi-threading, the C programming can use the fork to create a new process, can we say that C language support the multi-threading?
0
Comment
Question by:she1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 13535732
Hi she1,
> >as i know the java support multi-threading, the C programming can use
> >the fork to create a new process, can we say that C language support
> >the multi-threading?

The language itself does not support mult-threading, but specific implementations and extensions to the language does support multi-thread.
For example, POSIX functions are an extension to the language, which allows C programs to support multi-threading.

However, the C-language standard, has nothing to say about multi-threading.

Cheers!
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 13540804
Hi she1,

>C programming can use the fork to create a new process,
fork() creates a new process ... A process is fundamentally different from a thread ... Child process does not share its address space with the parent while all threads do!!! ... This ability to create a different process should not be confused with ability to create threads

>can we say that C language support the multi-threading?
No ... C language does not support multi-threading .... However there are several libraries which provide multi-threading capabilities, but none of them is a part of ANSI C standard.

Cheers!
sunnycoder
0
 
LVL 8

Accepted Solution

by:
ssnkumar earned 80 total points
ID: 13541821
>  can use the fork to create a new process,
C language itself doesn't support the concept of creating a process.
It is the underlying operating system that has to support this.
So, the fork() is a system call, which does kernel related operation to create a new process.
The same call may not work on another operating system (say, DOS or BeOS).
The reason is that, the OS may not support creation of new process or it's API may be different.

In the same way, multi-threading is a feature of the underlying architecture and OS.
If multi-threading is implemented as part of OS, then it can be extended to any programming language on that operating system, by creating a new library for that.

Hope this clears the doubt.
Please let us know, if you still have some confusion left.

-ssnkumar
0
 

Author Comment

by:she1
ID: 13584049
thanks for help, they are all helpful
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question