Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to tackle multiple threads in C

Status
Not open for further replies.

Mr Cappuccino

Junior Member level 1
Joined
Apr 22, 2006
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,408
I am relatively inexperienced in C though i've done alot of work on Java. I wanted to know if it is possible to use multithreading features in C because i know C doesn't support multithreading....So is it possible to cater with this inability? If so, how? And if not, then what should be done where the multiple threads are required? Would C not be a good option in that case?
 

lambtron

Full Member level 5
Joined
Nov 2, 2005
Messages
251
Helped
34
Reputation
68
Reaction score
8
Trophy points
1,298
Location
Portland, OR
Activity points
3,546
Re: Regarding C

C does support multithreading as long as you have the appropriate libraries and you are targeting a multithreaded operating system.

For example, if you are writing a windoze application, simply use CreateThread() to launch a c function as a new thread.
 

sreeni

Member level 1
Joined
May 24, 2006
Messages
35
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,286
Activity points
1,557
Re: Regarding C

U can write mutithreaded applications in Linux.
But in windows I think it is not possible.
But Visual C++ provides methods for mutithreading.
 

amraldo

Advanced Member level 4
Joined
Aug 29, 2004
Messages
1,185
Helped
145
Reputation
290
Reaction score
40
Trophy points
1,328
Location
Egypt
Activity points
5,880
Re: Regarding C

Hello,
Posix threading is only defined for C language only.
You can use it undr linux & under windows.
Amraldo
 

saeid5977

Junior Member level 2
Joined
May 23, 2006
Messages
23
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,283
Activity points
1,471
Regarding C

hi mutithreading is a feature of OS and when u use C under an OS that suport it u can write MT programs(for example dos has not MT feature and u cant and win32 and linux have and u can use it)
in win ucan use from CreateThread and in linux i think the fork function is for doing it. be success. excuse me cuse of my bad english.
 

ashwini182

Member level 1
Joined
Apr 21, 2006
Messages
36
Helped
13
Reputation
26
Reaction score
11
Trophy points
1,288
Activity points
1,546
Re: Regarding C

hey all whats this posix all about ? i have worked with c in win32 environment . i have heard about posix. whats it and hows it different?
 

Anno

Advanced Member level 4
Joined
Feb 8, 2006
Messages
106
Helped
14
Reputation
28
Reaction score
0
Trophy points
1,296
Location
South Africa
Activity points
1,899
Re: Regarding C

ashwini182 said:
hey all whats this posix all about ? i have worked with c in win32 environment . i have heard about posix. whats it and hows it different?
POSIX is the name used for most Linux, Unix and BSD systems.
As they all work the same in principle. It is easier to talk about POSIX than all
the other individually.
It differs a lot from Windows..:D
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top