Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-thread usage #143

Closed
dustturtle opened this issue Sep 20, 2016 · 4 comments
Closed

Multi-thread usage #143

dustturtle opened this issue Sep 20, 2016 · 4 comments

Comments

@dustturtle
Copy link

If I have a long long record, I will be happy to do the database action on background threads in order to have no blocking with UI.
BUT FCModel says :"FCModels can be used from any thread, but all database reads and writes are serialized onto the main thread, so you're not likely to see any performance gains by concurrent access."
What does this mean?
Thank you very much! need your help.

@tedrog36
Copy link

Having looked at the code in detail for the issue/question I posted yesterday, (#142) I think I can answer this for you.
All database requests are made on the main UI thread using dispatch_async. This means you cannot take advantage of performance gains of having multiple threads, for example, read/write from/to the database at the same time. (see fcm_onMainThread inline method in source code)

@dustturtle
Copy link
Author

Thank you ! I see the fcm_onMainThread and invokes around it. I think that means we can not benifit from databasequeue (fmdb supported, with it we can do actions on background threads then no blocking with UI). I will NOT use FCModel in my app (large numbers of data, sql execution may be slow) .
Do you agree with me?

@marcoarment
Copy link
Owner

That’s correct. FCModel is not designed for interactive use during long-running queries, so it’s probably not a good fit for your needs.

On Sep 20, 2016, at 11:00 PM, Achen [email protected] wrote:

Thank you ! I see the fcm_onMainThread and invokes around it. I think that means we can not benifit from databasequeue (fmdb supported, with it we can do actions on background threads then no blocking with UI). I will NOT use FCModel in my app (large numbers of data, sql execution may be slow) .
Do you agree with me?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@dustturtle
Copy link
Author

Thanks a lot! FCModel is great for it's simple & easy to use. I will try this in other scenes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants