• 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
OTCreateSystemTask() Replacement?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

OTCreateSystemTask() Replacement?


  • Subject: OTCreateSystemTask() Replacement?
  • From: email@hidden
  • Date: Sat, 7 Apr 2007 20:10:23 -0600

Hi, I need a way to run a cooperative thread or callback at system task time. I have a network class that needs to run even if a dialog box is showing. My code is not interrupt safe, it is an Idle() function that polls for UDP packets and handles keepalives/timeouts, that I normally call during my main loop. I tried creating a cooperative thread with NewThread() that just sits in a loop and beeps then yields every second, but unfortunately it only runs if I call YieldToAnyThread(). Dialog boxes evidently don't call the thread manager! That is a pretty bad mistake in the Mac OS haha. I guess that stuff is deprecated so there should be a modern routine that creates a cooperative thread that gets called during dialogs, or in WaitNextEvent() or RunApplicationEventLoop() etc.

I really don't want to get into preemptive threads and mutexes around WNE or my network class, just to emulate a simple cooperative thread. I can maybe patch SystemTask() if that is still possible. Really, I need OTCreateSystemTask() or something with identical functionality. I can't install an event filter because the networking needs to always run even if a system dialog is showing.

Thanx,

------------------------------------------------------------------------
Zack Morris              Z Sculpt Entertainment               This Space
email@hidden      http://www.zsculpt.com                 For Rent
------------------------------------------------------------------------
If the doors of perception were cleansed, everything would appear to man
  as it is, infinite. -William Blake, The Marriage of Heaven and Hell


_______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: OTCreateSystemTask() Replacement?
      • From: "Mike Cohen" <email@hidden>
    • Re: OTCreateSystemTask() Replacement?
      • From: Josh Graessley <email@hidden>
  • Prev by Date: Re: RemoteAccessInterface.h
  • Next by Date: Re: OTCreateSystemTask() Replacement?
  • Previous by thread: Re: RemoteAccessInterface.h
  • Next by thread: Re: OTCreateSystemTask() Replacement?
  • Index(es):
    • Date
    • Thread