blocks and threads

I want to know if blocks in c / cocoa run on a seperate thread to the main thread. Would they be useful for executing computationally expensive code while leaving the UI responsive?

Answers


Blocks are just snippets of code bundled up into a callable object. How they run is entirely up to the code that calls it.

Running blocks on a separate thread is not only possible, but is precisely the reason the blocks concept was introduced. It exists to support Grand Central Dispatch, which hides a lot of the complexity of concurrent programming behind a task-oriented model.


Need Your Help

PostgreSQL notice processing

c postgresql pointers libpq

I'm working on a C application that is suppose to talk to PostgreSQL. Right now I need to handle notices and warnings sent by the server but I'm at a loss on how to make it work.

Making the left column move according to selection?

javascript jquery smart-wizard

I came across a jQuery Wizard plugin at the following URI:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.