title: I want to give a priority each background thread and excute gradually
body: <p>This code generates Low memory warning because background 5 thread is almostly loading images in same time. </p>
  
  <p>I want to give a priority each thread and make lock &amp; unlock.
  I would make step by step thread. image 1 loading -> image2 loading -> image3 loading -> image4 loading.</p>
  
  <p>How can I do this?</p>
  
  <h3>viewcontroller</h3>
  
  <pre><code>-(void)viewDidLoad
  {            
   for(int i=0; i&lt;screenshotcount ; i++)
   {
      NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];  
      NSString * url=[detailItem.mScreenshot objectAtIndex:i];
      NSDictionary *args=[NSDictionary dictionaryWithObjectsAndKeys:
                         [NSNumber numberWithInt:i], @"screenNum",
                         [NSString stringWithString:url],@"url",
                         nil];
      [self performSelectorInBackground:@selector(loadImageScreenshot:) withObject:args];
      [pool release]; 
    }
  }
  </code></pre>
  
  <h3>loading image</h3>
  
  <pre><code>-(void) loadImageScreenshot:(NSDictionary *) args
  {
   NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 
   UIImage * screenshotImage=[UIImage imageWithStringURL:url];
   NSDictionary *args2=[NSDictionary dictionaryWithObjectsAndKeys:
                      [NSNumber numberWithInt:num], @"screenNum",
                      screenshotImage,@"image",
                      nil];                                                               
  
  [self performSelectorOnMainThread:@selector(assignImageToScreenshotImageView:) withObject:args2  waitUntilDone:YES];
  [pool release];
  }
  </code></pre>
  
  <h3>image add</h3>
  
  <pre><code>- (void) assignImageToScreenshotImageView:(NSDictionary *)arg
  { 
  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  UIImage * image= [arg objectForKey:@"image"];
  UIImageView *imageview=[UIImageView alloc]init];
                 .
                 .
  imageview.image=image;
  [self.mScreenshotSpace addSubview:imageview];
  [imageview release];
  [pool release];
  }
  </code></pre>
  
  <h3>image from url</h3>
  
  <pre><code>+(UIImage *)imageWithStringURL:(NSString *)strURL
  {
   NSURL *url =[NSURL URLWithString:strURL];
   NSData *   data=[[NSData alloc]initWithContentsOfURL:url options:NSDataReadingUncached error:&amp;error];
  
   UIImage * image=[UIImage imageWithData:data ];
   [data release];
   return image;
  }
  </code></pre>