• 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: Need help in Mac Networking.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help in Mac Networking.


  • Subject: Re: Need help in Mac Networking.
  • From: Justin Walker <email@hidden>
  • Date: Sat, 2 Oct 2004 14:58:25 -0700


On Oct 2, 2004, at 14:03, Zack Morris wrote:

On Oct 2, 2004, at 2:17 PM, Kent Sorensen wrote:

You should not use the PowerPlant networking classes on OS X. Especially on multiprocessor machines you will experience random crashes. That problem is well documented.
[snip]
This might be a really dumb question but...is there a threading model in unix that acts like an interrupt?

Not really. The OT Notifier scheme was developed to deal with the realities of doing network programming under Mac OS 9 (, 8, ...). That doesn't mean it's a good model, and it's one of the reasons that OT on Mac OS X is so difficult to get right.


The reason that most notifier driven OpenTransport apps die on X is that the notifier can be stalled to allow the main thread to execute. On 9, the notifier always ran to completion before execution was given back to the main thread. There needs to be a way to prioritize threads in unix so that one thread can't be suspended for a thread of lower priority, which would emulate interrupts exactly. If unix/the kernel can't be told to do this, I think that this is a huge hole, and I'd like to see Darwin add that ability, even if it breaks other unixes (they should have had that ability anyway).

There is no good reason to do this, and it likely will not happen. There are good ways to do asynchronous programming in a Unix environment, and these will work better. The areas you mention below can work without a problem, without the OT "interrupt thread" model.


This would also be very useful for scientific apps, and even for music or graphics double buffering, actually I can think of dozens of places where being able to give threads priority would make life better. Just to get one thing clear, this prioritization should only occur for the threads in an app, not for the rest of the OS.

P.P.S. The fact that you can't simply port most notifier apps to X without them crashing says to me that OT is not finished, and shouldn't have been closed until they wrote a workaround

Not hardly. OT is finished, and it is closed. It does mean that you have to work to port your app, but you are no longer programming for a "cooperative multitasking" environment.


(even if that involved extending the threading model). I seem to remember something about OTEnterNotifier() and OTLeaveNotifier() working as sort of a mutex from the main thread on X, but it seemed like there were gotchas with that method also.

Regards,

Justin

--
Justin C. Walker, Curmudgeon-At-Large  *
Institute for General Semantics        |   When LuteFisk is outlawed
                                       |   Only outlaws will have
                                       |       LuteFisk
*--------------------------------------*-------------------------------*

_______________________________________________
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: 
 >Need help in Mac Networking. (From: email@hidden)
 >Re: Need help in Mac Networking. (From: "Andy Cave" <email@hidden>)
 >Re: Need help in Mac Networking. (From: Kent Sorensen <email@hidden>)
 >Re: Need help in Mac Networking. (From: Zack Morris <email@hidden>)

  • Prev by Date: Re: Need help in Mac Networking
  • Next by Date: Re: Need help in Mac Networking.
  • Previous by thread: Re: Need help in Mac Networking.
  • Next by thread: Re: Need help in Mac Networking.
  • Index(es):
    • Date
    • Thread