By: Aaron Hillegass in Cocoa Tutorials on 2010年09月24日 [フレーム]
Multithreading gets a lot of hype because it enables you to take advantage of multiple processors and cores. Multithreading can also ensure that your application stays responsive while it is doing some sort of processing in the background. Multithreaded programming is, however, difficult: The activities of one thread often stomp on the data being used by another.
You can often use multiprocessing to get much of the benefit of multithreaded programming with few of the headaches. That is, instead of creating a new thread to do some sort of processing, simply create a whole new process.
Following are other benefits of multiprocessing over multithreading.
Rewriting the capabilities of many command line tools would be very time consuming.
If you have a memory leak in the external process, the operating system will clean up for you when the external process ends.
The external process can run as a user other than the application. Thus, the external process can have a set of permissions completely different from those of the application.
Although not as glamorous as multithreading, multiprocessing is probably more useful in real life.
This policy contains information about your privacy. By posting, you are declaring that you understand this policy:
This policy is subject to change at any time and without notice.
These terms and conditions contain rules about posting comments. By submitting a comment, you are declaring that you agree with these rules:
Failure to comply with these rules may result in being banned from submitting further comments.
These terms and conditions are subject to change at any time and without notice.
Most Viewed Articles (in Cocoa )
Using NSOpenGLView in Cocoa Programming in Mac
Multithreading versus Multiprocessing in Mac OS X.
What is Cocoa? A brief history of Cocoa.
Garbage Collector in Cocoa Programming in Mac
Listing of files in a zip file in Mac OS X.
Printing in Mac Cocoa Programming
Web Services in Mac Cocoa Programming
Listing of files in a tar file in Mac OS X.
Weak References in Mac Cocoa Programming
Life Cycle of a Cocoa Application
Objects, Classes, Methods, and Messages in Cocoa Programming
Latest Articles (in Cocoa)
Listing of files in a tar file in Mac OS X.
Listing of files in a zip file in Mac OS X.
Multithreading versus Multiprocessing in Mac OS X.
Using NSOpenGLView in Cocoa Programming in Mac
Garbage Collector in Cocoa Programming in Mac
Weak References in Mac Cocoa Programming
Web Services in Mac Cocoa Programming
Printing in Mac Cocoa Programming
What is Cocoa? A brief history of Cocoa.
Programming Language used in Cocoa Programming
Objects, Classes, Methods, and Messages in Cocoa Programming
Listing of files in a tar file in Mac OS X.
Listing of files in a zip file in Mac OS X.
Multithreading versus Multiprocessing in Mac OS X.
Using NSOpenGLView in Cocoa Programming in Mac
Garbage Collector in Cocoa Programming in Mac
Weak References in Mac Cocoa Programming
Web Services in Mac Cocoa Programming
Printing in Mac Cocoa Programming
What is Cocoa? A brief history of Cocoa.
Programming Language used in Cocoa Programming
Objects, Classes, Methods, and Messages in Cocoa Programming
© 2023 Java-samples.com
Tutorial Archive: Data Science React Native Android AJAX ASP.net C C++ C# Cocoa Cloud Computing EJB Errors Java Certification Interview iPhone Javascript JSF JSP Java Beans J2ME JDBC Linux Mac OS X MySQL Perl PHP Python Ruby SAP VB.net EJB Struts Trends WebServices XML Office 365 Hibernate
Latest Tutorials on: Data Science React Native Android AJAX ASP.net C Cocoa C++ C# EJB Errors Java Certification Interview iPhone Javascript JSF JSP Java Beans J2ME JDBC Linux Mac OS X MySQL Perl PHP Python Ruby SAP VB.net EJB Struts Cloud Computing WebServices XML Office 365 Hibernate