• 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: POSIX sockets and event loops
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: POSIX sockets and event loops


  • Subject: Re: POSIX sockets and event loops
  • From: "Duane Murphy" <email@hidden>
  • Date: Thu, 20 May 2004 15:16:53 -0700

--- At Thu, 20 May 2004 15:57:17 -0500, Aaron Ballman wrote:

>As much as I hate to admit this: we have an event loop that's using
>WaitNextEvent. When sockets are active, we pause for as little time
>possible (pass in 0 to WaitNextEvent), yet I am still finding that
>about 15% of my application's time is being spent in that one call.
>I am determining this by using Shark FWIW.
>
>Because my application uses select to poll the socket for sends and
>receives, this sort of a hiccup in the application's event loop seems
>to slow my transfers down more than I care for.
>
>Aside from the obvious (but quite difficult) answer of: stop using
>WaitNextEvent and use Carbon events everywhere... is there a way to
>cause WaitNextEvent to wake up when network I/O is occurring? For
>example, if I were to use signals instead of select, would the
>signals cause WaitNextEvent to not delay so long?

You can use Carbon Events and WNE togther. I do it all the time,
specifically for network callbacks. Works great. Less filling.

WaitNextEvent just calls RunApplicationEventLoop for you. You're still
executing CarbonEvents, you just never see them.

...Duane
_______________________________________________
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.


  • Follow-Ups:
    • Re: POSIX sockets and event loops
      • From: "Duane Murphy" <email@hidden>
References: 
 >POSIX sockets and event loops (From: Aaron Ballman <email@hidden>)

  • Prev by Date: POSIX sockets and event loops
  • Next by Date: gethostname
  • Previous by thread: POSIX sockets and event loops
  • Next by thread: Re: POSIX sockets and event loops
  • Index(es):
    • Date
    • Thread