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

Re: OTCreateSystemTask() Replacement?


  • Subject: Re: OTCreateSystemTask() Replacement?
  • From: Josh Graessley <email@hidden>
  • Date: Sat, 7 Apr 2007 19:21:46 -0700


Are you trying to develop for Mac OS X or Mac OS 9?

For Mac OS X, you should seriously consider switching to a CFRunLoop and using sockets and CFSocket to handle networking.

NewThread, OTCreateSystemTask, WaitNextEvent, SystemTask are all a compatibility shim to keep old code limping along. They are not intended for new code development.

-josh

On Apr 7, 2007, at 7:10 PM, email@hidden wrote:

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:
40apple.com


This email sent to email@hidden

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: email@hidden
References: 
 >OTCreateSystemTask() Replacement? (From: email@hidden)

  • Prev by Date: OTCreateSystemTask() Replacement?
  • Next by Date: Re: OTCreateSystemTask() Replacement?
  • Previous by thread: OTCreateSystemTask() Replacement?
  • Next by thread: Re: OTCreateSystemTask() Replacement?
  • Index(es):
    • Date
    • Thread