- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- processes vs threads
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 07:28 AM
08-31-2004 07:28 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 07:43 AM
08-31-2004 07:43 AM
Re: processes vs threads
In theory there shouldn't be any difference *as long as* they're doing the same thing.
The system should treat them the same.
Each process OR thread is a scheduable, runnable entity that requires it's own kernel stack, user area, etc.
The difference should boil down to what kind of work & what else is required (disk I/O, Net I/O, etc.) to get that work done as well as how the work is getting done. It's amazing to see the performance difference caused by using the 3 different kinds of fork()s available.
A.T.& T's original fork(). The BSD new & improved vfork(). And the HP copy-on-write in the parent & copy-on-access in the child fork().
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 08:05 AM
08-31-2004 08:05 AM
Re: processes vs threads
pthread library seems to be the biggest culprit in threading performance degradation?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 08:18 AM
08-31-2004 08:18 AM
Re: processes vs threads
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 08:37 AM
08-31-2004 08:37 AM
Re: processes vs threads
On top of the pthread test. I've noticed in less isolated cases that running a process with multiple threads is less efficient then multi processes with a single thread (with the same work). This could be RW's threading implementation or something else. But my isolated test of adding pthread library was very significant. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2004 03:54 AM
09-01-2004 03:54 AM
SolutionI have never been a fan of threads. The implicit sharing of almost every process resource is both expensive because of access synchronization and risky because of the requirement for a programmer to identify every critical section. It gets even worse when application authors are tempted to use third party libraries that may or may not be threadsafe.
I feel that most applications that use threading would be better off using a stable pool of processes with explicit allocation of shared memory and interprocess communication.
That confines the cost and risk of shared resources to small specific regions of code.
It isn't fashionable. But it is good engineering.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2004 05:07 AM
09-01-2004 05:07 AM
Re: processes vs threads
As has been pointed out, enabling multiple threads in a process brings overhead. If you're not EXPLOITING the ADVANTAGES of multithreading in the process, then that overhead is clearly visible as a performance cost. This is like hooking an enormous trailer onto your car without actually carrying anything, and complaining that your gas mileage has suffered even though you're not USING the trailer. You probably wouldn't even think of doing that: so don't think of hooking threads to your process without using them.
A comparison between "a process with 2 threads" and "2 processes" is inherently flawed because it's not possible for both cases to be running identical code. There are differences, and probably SUBSTANTIAL differences, between those two programs that are not expressed in the description. They may accomplish the same thing, but they still do it in vastly different ways. (And in fact, if they DON'T, then one or the other is simply wrong and that may well explain the differences...)