Concurrent Cetching From CoreStore Async #188

Closed
opened 2025-12-29 18:24:11 +01:00 by adam · 2 comments
Owner

Originally created by @SlinToWin on GitHub (Nov 15, 2017).

Use Case:
One Site in my App has two Data Models, one with many entries, one with a few.
When issuing a fetch on both of them on start, the heavy fetch blocks the small fetch because all transactions on CoreStore is done in a serial background queue.

Is there a way to concurrent fetch Data from Core Store asynchronous?

Originally created by @SlinToWin on GitHub (Nov 15, 2017). Use Case: One Site in my App has two Data Models, one with many entries, one with a few. When issuing a fetch on both of them on start, the heavy fetch blocks the small fetch because all transactions on CoreStore is done in a serial background queue. Is there a way to concurrent fetch Data from Core Store asynchronous?
adam closed this issue 2025-12-29 18:24:11 +01:00
Author
Owner

@JohnEstropia commented on GitHub (Nov 21, 2017):

Just to clarify, your two fetches are both from inside transactions, correct?

If your two data models are unrelated to each other, I recommend separating their DataStack (and files). This way each model will have their own serial transactions.

The safety of CoreStore's transactions lie on the serial execution. If you wish to bypass this safety you can use a unsafe transactions (dataStack.beginUnsafe()) you can use freely on any queue. At that point, you are on your own with thread management.

@JohnEstropia commented on GitHub (Nov 21, 2017): Just to clarify, your two fetches are both from inside transactions, correct? If your two data models are unrelated to each other, I recommend separating their DataStack (and files). This way each model will have their own serial transactions. The safety of CoreStore's transactions lie on the serial execution. If you wish to bypass this safety you can use a unsafe transactions (`dataStack.beginUnsafe()`) you can use freely on any queue. At that point, you are on your own with thread management.
Author
Owner

@SlinToWin commented on GitHub (Dec 9, 2017):

Yeah this is correct.
My thought was only some sort of concurrent read access, but sure there must be some sync managment. I have worked around that issue so i close this one. Thanks for your help.

@SlinToWin commented on GitHub (Dec 9, 2017): Yeah this is correct. My thought was only some sort of concurrent read access, but sure there must be some sync managment. I have worked around that issue so i close this one. Thanks for your help.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore-JohnEstropia#188