• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Thread context switch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Thread context switch


  • Subject: Thread context switch
  • From: Martin Tauber <email@hidden>
  • Date: Sun, 20 Nov 2005 22:27:19 +0100

Dear newsgroup!

I am working on a multithreaded application which has two threads. The first thread should be responsible for interacting with the user and the second thread is used to do background work. Now I am struggeling with the context switch of NSThreads. The second thread should be loading thumbnails, which are displayed by the first thread. When I start my application everthing works as expected. The window is displayed and the thumbnails are displayed one after the other by the first thread after being loaded by the second thread. But after a view thumbnails beeing shown, the first thread hangs until the second thread has loaded all the thumbnails requested. It seams that the second thread does not pass control to the first thread until the last thumbnail is loaded. This confuses me because my expectation was that as soon as the second thread does an I/O request (on which it then would have to wait) it would pass control back to the first thread.

Any ideas why the second thread does not switch back control? Any Ideas on how I can force it to switch control?

thanks
Martin

P.S. The two threads are communicating via DO. The request to load a thumbnail is passed to the second thread using oneway. (Remember it works fine for the first three or four thumbnails, then the application hangs until the other thirty thumbnails are loaded)

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Thread context switch
      • From: Cameron Hayne <email@hidden>
  • Prev by Date: Re: How do I call a specific applescript handler and pass arguments?
  • Next by Date: Re: Modal dialog weirdness
  • Previous by thread: Re: How do I call a specific applescript handler and pass arguments?
  • Next by thread: Re: Thread context switch
  • Index(es):
    • Date
    • Thread