I am writing a javascript HTML5 phonegap application. I am using SQLite to store data. For the sake of performance, i am undertaking database inserts asynchronously i.e. I do not need to call the next operation at the callback of the previous Database operation. Internally, i believe javascript is creating a worker for each operation hence multi-threading so to speak.
The problem now is , How do i know that all workers have completed their tasks? e.g, in order to tell the user that all data has been saved?