Re: Bluetooth on Snow Leopard
Re: Bluetooth on Snow Leopard
- Subject: Re: Bluetooth on Snow Leopard
- From: Camille Troillard <email@hidden>
- Date: Wed, 9 Sep 2009 20:38:02 +0200
Hello Brian,
Yes IOBluetooth is really meant to live on the main thread.
If you really need to run your bluetooth code separately, I would suggest running it in a separate process. I have tried this approach, and it works fairly well. And state between the two processes can be easily maintained with distant objects if you are using objective-c.
Snow Leopard brings a lot of new technologies especially multi-processing-wise, but it also brings a lot of questions for us, developers. For example, I think the question of concurrency and device access from user space is not limited to bluetooth, but the IOKit in general.
For example, although Grand Central Dispatch can manage kernel event source, it is not clear how this integrates with existing APIs. I guess this is something will see in future updates, or farther in the future, 10.7.
Best,
Camille
On Wed, Sep 9, 2009 at 7:39 PM, Brian M. Criscuolo
<email@hidden> wrote:
Hi all,
Realizing the list traffic is pretty low, I thought I'd give this one a try anyway.
We have some old(er) code that deals with Bluetooth RFComm connections in a weird and probably a not-altogether correct way, but its been working for years successfully. In the past (Tiger and Leopard) we were handling rfcommChannelData delegate callbacks on a secondary thread - which allowed a blocking open-source library to be able to read data off of a queue as rfcommChannelData pushed the data received in.
Now, in Snow Leopard, this isn't working - all delegate and notification callbacks from IOBluetooth are happening on thread 1 (the main thread), which means that our code isn't working.
I suspect that what we're seeing is the correct behavior from IOBluetooth - comments here and there (including one from Jason Giles) point to the fact that IOBluetooth isn't thread safe and should be running entirely on the main thread.
My question: how much has the inter-thread operation of IOBluetooth changed in Snow Leopard, and is what I'm seeing expected behavior? There is pretty much no discoverable information about the thread safety of IOBluetooth, unfortunately.
Thanks in advance for any help possible.
b
********************
Brian M. Criscuolo
Lead Software Engineer
Mark/Space, Inc.
email@hidden
<http://www.markspace.com>
Synchronize:
Palm Prē | iPhone | BlackBerry | Windows Mobile | Palm OS | Symbian | Android | PSP | Macintosh | Windows
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev 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.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden