// // MPT_Scheduler.h // AUCoderDemo // // Created by Andrew Salamon on 6/5/08. // Copyright 2008 Machine Perception Laboratory, University of California San Diego.. All rights reserved. // #import @protocol SchedulerDelegateProtocol - (void)handleResults:(NSDictionary *)results; - (void)handleUnsortedResults:(NSDictionary *)pluginResults; @end @interface MPT_Scheduler : NSObject { id delegate; id oneProc; // used if there is only one processor object. NSArray *processors; NSMutableArray *available; NSConditionLock *condLock; BOOL stopping; int maxThreads; // we may have more processors than this, but should only use up to this many at a time. } + (unsigned int)availableCPUs; + (unsigned int)numThreads; + (void)setNumThreads:(unsigned int)value; - (id)initWithDelegate:(id)_delegate; - (void)createProcessors; - (void)scheduleInput:(NSDictionary *)inputs; - (BOOL)doesScheduleInput:(NSDictionary *)inputs; - (BOOL)isEmpty; - (BOOL)isAvailable; // Are there any available processors? - (void)cleanup; // only call this when the application is quitting - (id)delegate; - (void)setDelegate:(id)value; - (int)maxThreads; - (void)setMaxThreads:(int)value; @end