• 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: Crash in CFReadStreamOpen
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash in CFReadStreamOpen


  • Subject: Re: Crash in CFReadStreamOpen
  • From: Benoit Foucher <email@hidden>
  • Date: Wed, 27 May 2009 00:12:25 +0200

On May 26, 2009, at 11:35 PM, Jens Alfke wrote:


On May 26, 2009, at 1:42 PM, Benoit Foucher wrote:

I'm getting an EXC_BAD_ACCESS crash in CFReadSreamOpen and I don't understand why. The code only fails with OS X 10.5.7. It works fine on 10.5.6. I wonder if this is perhaps because I add the stream to another thread's run loop from the main thread. However, I didn't see any mention of this not being thread safe -- on the contrary the documentation seems to indicate that CF run loop functions are thread safe...

I've had trouble in the past with thread-safety of CFRunLoop, regardless of what the docs say.


Scheduling something on a different thread's runloop is a really unusual thing. Ordinarily you'd do the setup and scheduling (i.e. opening the stream) on the same thread that will be handling the events. What's your code trying to do?

It's trying to open the stream's connection without blocking and get a notification through a callback when the stream is opened. I have a dedicated thread for running the run loop and I register the stream with this dedicated thread's run loop from the calling thread (the calling thread is busy doing something else after that -- it can't run a run loop). So far, it worked well. I'll try to change my code to do the registration with the run loop from the thread that is running it and see if this solves the crash. Thanks for your help.


Cheers,
Benoit.



—Jens

_______________________________________________ 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: 
 >Crash in CFReadStreamOpen (From: Benoit Foucher <email@hidden>)
 >Re: Crash in CFReadStreamOpen (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Crash in CFReadStreamOpen
  • Next by Date: Re: Want to block HTTP(web) access but not filesharing
  • Previous by thread: Re: Crash in CFReadStreamOpen
  • Next by thread: Re: Crash in CFReadStreamOpen
  • Index(es):
    • Date
    • Thread