Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
sven_niemann
Posts: 12
Registered: ‎09-18-2013
My Device: Z10
My Carrier: none

Re: Grand Central Dispatch

I will try, just to avoid the qthread **bleep** :smileyvery-happy:

Please use plain text.
Developer
Zmey
Posts: 1,508
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: Grand Central Dispatch

Hi,

 

QFuture concept is already very similar to GCD.

 

I think this can be done using QFutureWatcher. Connect to it's finished() signal:

http://developer.blackberry.com/native/reference/cascades/qfuturewatcher.html#details

There's also some sample code on the help page.

 

 


Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Contributor
sven_niemann
Posts: 12
Registered: ‎09-18-2013
My Device: Z10
My Carrier: none

Re: Grand Central Dispatch

yes, but its limited to signals like finished, no custom signals possible i guess...

not really what i need i think...

 

once again:

 

I start something in a background thread (kind of a daemon). from this thread i need to execute something in main

 

 

Please use plain text.
Developer
slashkyle
Posts: 798
Registered: ‎10-16-2012
My Device: Red Z10, Dev Alpha C
My Carrier: Telus

Re: Grand Central Dispatch

I also posted a github sample on using QTConcurrent to run tasks in a separate thread, It's nothing advanced but will get your toes wet

 

https://github.com/slashkyle/Cascades-Samples/tree/master/QtConcurrent

Please use plain text.
Contributor
sven_niemann
Posts: 12
Registered: ‎09-18-2013
My Device: Z10
My Carrier: none

Re: Grand Central Dispatch

not usefull...

your thread is finished when updateLabel() is called, i need to communicate with main thread from a still running background thread
Please use plain text.
Developer
BBSJdev
Posts: 5,948
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Grand Central Dispatch

You can keep running around the issue but at some point you are going to have to bite the bullet. :smileyhappy:

 

You need thread signalling and data passing, so use QThread with QMutex and QT signals & slots it does what you want and isn't that hard to implement.

 

If you want to wait for something exactly like GCD to be included in BB10 then you are welcome to do that too but you may be waiting a long time. :smileyhappy:


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.