Nsthread-(void) Start vs Java Thread implements Runnable

Source: Internet
Author: User

This method spawns the new thread and invokes the receiver's method on the main new thread. If you initialized the receiver with a target and selector, the default main method is invokes that selector automatically.

If This thread was the first thread detached in the application, this method posts the nswillbecomemultithreadednotific ation with object nil to the default notification center.

Spawn: Egg, child, production;

/** 
* A {@code Thread} is a concurrent unit of execution. It has a own call stack
* For methods being invoked, their arguments and local variables. Each application
* have at least one thread running when it was started, the main thread, in the main
* {@link Threa DGroup}. The runtime keeps its own threads in the system thread
* group.
*
* <p>there is both ways to execute cod E in a new thread.
* can either subclass {@code Thread} and overriding its {@link #run ()} method,
* or construct a new {@code Th Read} and pass a {@link Runnable} to the constructor.
* In either case, the {@link #start ()} method must is called to actually execute
* The new {@code Thread}.
*< br> * <p>each {@code thread} has a integer priority this affect how the Thread was
* scheduled by the OS. A new thread inherits the priority of its parent.
* A thread ' s priority can is set using the {@link #setPriority (int)} method.
*/

Nsthread-(void) Start vs Java Thread implements Runnable

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.