• 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
OpenTransport on OS X: Behavior of asynchronous API calls.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

OpenTransport on OS X: Behavior of asynchronous API calls.


  • Subject: OpenTransport on OS X: Behavior of asynchronous API calls.
  • From: Matt Scopp <email@hidden>
  • Date: Mon, 4 Nov 2002 18:17:02 -0800

Hello all. For those of you using the Open Transport APIs in the Carbon environment on OS X, I wanted to mention an unexpected behavior that you may encounter and how you can deal with it. The Carbon implementation of Open Transport uses multiple worker threads in order to emulate asynchronous API calls. This introduces a possibility that hasn't existed on previous OT implementations: When making an API call on an asynchronous provider, it's actually possible for the results of the call to arrive and be delivered to your notifier before the call itself returns.

One specific example of unwanted behavior that we have seen involves so-called "missing T_GODATA events" on asynchronous endpoints that have been flow-controlled. Analysis revealed that what actually happened in that case was that the application called OTSnd on one thread, the send was flow-controlled, but the flow control lifted very quickly and a different thread (one of OT's worker threads) called the application's notifier with a T_GODATA event before OTSnd ever returned kOTFlowErr to the calling code.

The OTEnterNotifier and OTLeaveNotifier functions can be used to prevent this from happening. Calling OTEnterNotifier on a provider disables notifications on that provider until OTLeaveNotifier is called on it. These calls can therefore be used to bracket critical sections of code that require exclusion from a notifier executing concurrently, like the OTSnd in the above example.


- Matt
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: airport base station modem
  • Next by Date: Re: Multiple airport Settings
  • Previous by thread: Re: Multiple airport Settings
  • Next by thread: Looking for Interface Name kind of registry
  • Index(es):
    • Date
    • Thread