Multithreaded

9 views
Skip to first unread message

David

unread,
Mar 1, 2012, 4:30:58 PM3/1/12
to btsta...@googlegroups.com
I am reimplementing the cocoa stack manager example to use grand central dispatch to offload all Bluetooth calls off the main thread.

Are there any gotchas I need to be aware of? If I get it working, what interest is there to have this as part of the code base?

Cheers,
Dave

Matthias Ringwald

unread,
Mar 15, 2012, 1:38:41 PM3/15/12
to btsta...@googlegroups.com
Hi Dave

I guess the main gotcha with that is that only one thread can call the function to send a packet over the socket to the BTdaemon at the same time, so you would need a mutex there.

However, I'm wondering why you would like to do that. The client app, like the cocoa example, only send and receive packets from/to the daemon. This means, I don't expect that code to block at all as the unix socket provides some buffering.

Best
Matthias

> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To post to this group, send email to btsta...@googlegroups.com.
> To unsubscribe from this group, send email to btstack-dev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/btstack-dev?hl=en.
>

Reply all
Reply to author
Forward
0 new messages