mardi 28 juillet 2015

Inserting Data in Sqlite tables using multithreading

I have a sqlite Db with diff tables. In order to increase the performance, i want to use multithreading to insert data in Sqlite. So to achieve that, if i used [operationQueForInsertingDataInSqlite setMaxConcurrentOperationCount:1]; it is working fine, but its too slow.

So what i did is made it [operationQueForInsertingDataInSqlite setMaxConcurrentOperationCount:6] and use NSOperation que to make 6 diff threads to execute them parallel.

even while inserting DB i am using dispatch_async(dispatch_get_main_queue(),^{ });

To avoid DB error,but it doesn't seems to be working. Any help will be highlighly appreciated..

Aucun commentaire:

Enregistrer un commentaire