Does it support Multi-thread? #152

Closed
opened 2025-12-29 15:25:49 +01:00 by adam · 2 comments
Owner

Originally created by @ondev on GitHub (Jul 14, 2017).

Originally created by @ondev on GitHub (Jul 14, 2017).
adam added the question label 2025-12-29 15:25:49 +01:00
adam closed this issue 2025-12-29 15:25:49 +01:00
Author
Owner

@JohnEstropia commented on GitHub (Jul 15, 2017):

@ondev That depends what you mean by "it" and "multi-thread".
CoreStore runs on top of Core Data, so all threading support offered by Core Data is inherited by Core Store. This includes reading and writing objects from a background thread.

On the other hand, CoreStore will enforce that object properties are accessed only on the queue they correspond to. In that sense, an object is not "multi-thread". For example, an object read from the main thread cannot be manipulated directly from a transaction queue. There are utilities to get the correct object for the correct queue (transaction.edit(_:), transaction.fetchExisting(_:), etc).

@JohnEstropia commented on GitHub (Jul 15, 2017): @ondev That depends what you mean by "it" and "multi-thread". CoreStore runs on top of Core Data, so all threading support offered by Core Data is inherited by Core Store. This includes reading and writing objects from a background thread. On the other hand, CoreStore will enforce that object properties are accessed only on the queue they correspond to. In that sense, an object is not "multi-thread". For example, an object read from the main thread cannot be manipulated directly from a transaction queue. There are utilities to get the correct object for the correct queue (`transaction.edit(_:)`, `transaction.fetchExisting(_:)`, etc).
Author
Owner

@ondev commented on GitHub (Jul 20, 2017):

Thanks your reply.

@ondev commented on GitHub (Jul 20, 2017): Thanks your reply.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#152