LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-04-2004, 11:46 AM   #1
ltcstyle
LQ Newbie
 
Registered: Nov 2004
Location: UK
Distribution: FC3
Posts: 12

Rep: Reputation: 0
multi-thread VS multi-process


hi all

why most of Unix-based software is multi-process but not multi-thread?
like Qmail,Sendmail,APACHE etc. especially APACHE, its windows version is multi-thread, but it's unix version is multi-process???
 
Old 12-04-2004, 04:07 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Apache v2 is multi-threaded.
Linux threading implementation has for a long time been not very stable and/or efficient (and perhaps is it still the case), so it may have been a reason why developers have often chosen the simpler and more error forgiving multi-processing way.
 
Old 12-04-2004, 04:41 PM   #3
aluser
Member
 
Registered: Mar 2004
Location: Massachusetts
Distribution: Debian
Posts: 557

Rep: Reputation: 43
iirc, processes are more expensive in windows than in linux. Thus, if a linux app doesn't actually *need* to share memory, it just uses processes. Even if it does need to share memory, there's always SysV shared memory which lets you get around some thread gotchas.
On windows, threads are substantially less expensive than processes.
 
Old 12-04-2004, 06:53 PM   #4
ltcstyle
LQ Newbie
 
Registered: Nov 2004
Location: UK
Distribution: FC3
Posts: 12

Original Poster
Rep: Reputation: 0
I just shifted from Windows programming in these 3 months.
I know processes is more expensive than thread in Windows, but I don't know about Linux, so... do you mean thread in Linux is not more efficient than process?

another question: could I use pthread in Windows?
I think most of multi-process program in Linux use a lot Linux feature to run their program. If I want my multi-thread program runs in both Windows and Linux, it seems use multi-thread better than multi-process, isn't it?

I found gnu/pth is support Windows http://www.gnu.org/software/pth/
does it really works well in Windows
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
global integer in the multi-thread application lordofring Programming 1 08-23-2005 09:36 PM
Multi-Thread/Process Pipes JanusPaul Programming 2 02-27-2005 02:52 PM
How do you change card# of multi multi-media cards. Nichole_knc Slackware 3 12-01-2004 12:49 PM
Multi process cebug mickstaff Programming 11 06-10-2004 08:33 PM
Multi-thread debugging with gdb on RedHat 9.0 Rodney Riggs Linux - Software 0 09-23-2003 04:34 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration