Re: IOBluetoothUI thread safe?
Re: IOBluetoothUI thread safe?
- Subject: Re: IOBluetoothUI thread safe?
- From: Joseph Kelly <email@hidden>
- Date: Fri, 7 Oct 2005 14:30:27 -0700
I've been down the "do it all from the main thread road" many times
now, and what worries me most is that one variant of my product will
be used from a WNE-CFM (PowerPlant OS 9/OS X) app that's linked to my
bluetooth code via the CFBundle apis. In other words, I might not
have any say as to when exactly the main run loop will get time
Oh well. I'll put it in the main thread.
joe
On Oct 7, 2005, at 1:00 PM, Eric Brown wrote:
IOBluetoothUI is not thread safe. It uses both IOBluetooth and
AppKit of which neither are thread safe. Your best bet is to use
the main thread as your Bluetooth thread and enqueue any Bluetooth
operations to be performed on it. Not ideal, but it should work
for you.
- Eric
On Oct 7, 2005, at 11:52 AM, Joseph Kelly wrote:
Background: To operate within my own specific requirements that I
need to kick off a bunch of bluetooth operations from any thread
(including the main thread) AND also operate within the
IOBluetooth requirement that all operations be performed on a same
thread, I've spawned a worker thread that handles all bluetooth
operations (it gets awakened whenever there are commands placed in
a queue and performs the bluetooth operations asynchronously,
while the requesting threads are blocked until completion).
So, is it safe or even advisable to call into IOBluetoothUI from
this worker thread? My wish is to put up the standard bluetooth
discovery dialog to let the user choose which device to connect
to. The standard wisdom is never run UI from a non-main thread,
but I might not have a choice?
joe
_______________________________________________
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