• 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: "Mike Cohen" <email@hidden>
  • Date: Sat, 7 Apr 2007 22:56:36 -0400

Unless you're writing code for OS 9 (which you probably shouldn't be
doing), OT shouldn't be used. Look into using sockets or CFNetwork
instead.

On 4/7/07, email@hidden <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:
This email sent to email@hidden


_______________________________________________
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


References: 
 >OTCreateSystemTask() Replacement? (From: email@hidden)

  • Prev by Date: Re: OTCreateSystemTask() Replacement?
  • Next by Date: Re: OTCreateSystemTask() Replacement?
  • Previous by thread: Re: OTCreateSystemTask() Replacement?
  • Next by thread: How to get dialup modem info, and how to set a connection
  • Index(es):
    • Date
    • Thread