• 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
Re: Self-scheduling threading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Self-scheduling threading


  • Subject: Re: Self-scheduling threading
  • From: John Stiles <email@hidden>
  • Date: Wed, 16 Mar 2005 19:07:57 -0800

On Mar 16, 2005, at 6:22 PM, Scott Ribe wrote:

Fibers seem like co-routines or co-operative threads. NSThread doesn't
do co-operative threads, AFAIK. Carbon's co-operative API has probably
been deprecated or removed. And I would love a usable co-routine
library.

Well, I haven't needed to use it, so I can't comment on it, but for what
it's worth:


<http://www.akira.ruc.dk/~keld/research/COROUTINE/COROUTINE-1.0/DOC/ COROUTIN
E_REPORT.pdf>


Of course it's C++, thus not completely "Cocoa-ready" out of the box, but I
bet that could worked around ;-)

This technique doesn't seem as good as using pthreads. Not to bring up the Carbon Thread Manager again :) but its technique was to spawn a bunch of pthreads and only let one thread run at a time by using a semaphore that a thread needed to grab in order to run, which is a technique you could surely implement yourself in raw pthreads or using NSThreads and NSLocks. Somehow this approach seems simpler to me than beating on the stack with memcpy :) :) Man that technique freaks me. Maybe it works but... so gross! And I'd be extremely concerned about using it in production code. Memcpy'ing over the currently live stack just doesn't seem safe.


_______________________________________________
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: Self-scheduling threading
      • From: Scott Ribe <email@hidden>
References: 
 >Re: Self-scheduling threading (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: slow NSWorkspaceDidWakeNotification
  • Next by Date: Getting notified when a document closes
  • Previous by thread: Re: Self-scheduling threading
  • Next by thread: Re: Self-scheduling threading
  • Index(es):
    • Date
    • Thread