Skip to content

Thread Pool is a thread queue. You could push threads to ThreadPool, and then it will process the thread.

Notifications You must be signed in to change notification settings

nullpic/ThreadPool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#ThreadPool 1.0

Kelp http://kelp.phate.org/
MIT License

Thread Pool is a thread queue.
You could push threads to ThreadPool, and then it will process the thread.

ThreadPool *pool = [ThreadPool new];

NSThread *thread = [[NSThread alloc] initWithTarget:self
                                           selector:@selector(threadExecuteCode)
                                             object:nil];
thread.name = @"Thread A";
[pool pushThread:thread];

thread = [[NSThread alloc] initWithTarget:self
                                 selector:@selector(threadExecuteCode)
                                   object:nil];
thread.name = @"Thread B";
[pool pushThread:thread];
- (void)threadExecuteCode
{
    for (int index = 0; index < 10; index++) {
        NSLog(@"%@: %i", [NSThread currentThread].name, index);
    }
}

About

Thread Pool is a thread queue. You could push threads to ThreadPool, and then it will process the thread.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published