• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Clarification on passing EOs to background threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clarification on passing EOs to background threads


  • Subject: Re: Clarification on passing EOs to background threads
  • From: Paul Hoadley <email@hidden>
  • Date: Sat, 28 Sep 2013 11:51:20 +0930

On 28/09/2013, at 12:52 AM, Jean-François Veillette <email@hidden> wrote:

You might consider using a brand new EOF stack (create a new Object Store Coordinator) for the background task.  The advantage would be that you are the only on using the database connection, no jdbc locking problem with the main thread.
The disadvantage is that you do not share the snapshot, so that even with a fetch from global id you will go down to the database since your snapshot cache is still empty.

As a generic way of doing, I would seriously consider going that route.  To make it easier to work with, I would have an api on the background task object to give you the editing context for that specific background task, then (from your main thread) you can fill it up, prepare, fetch, do whatever, then when you really detach the background thread (the main thread no longer have pointer to that editingContext), it is really independent and has no impact on the main thread (you are safe).

If you want to be « generic » and allow your object to be called while processing the report is going on, you could make an api where the background task invoke a « target » with an « action » (remember something?) that you gave it first.  That way, you could (by giving the right « target ») access the context that triggered the report.

Thanks Jean-François.  Great ideas.


-- 
Paul Hoadley
http://logicsquad.net/



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Clarification on passing EOs to background threads (From: Chuck Hill <email@hidden>)
 >Re: Clarification on passing EOs to background threads (From: Paul Hoadley <email@hidden>)
 >Re: Clarification on passing EOs to background threads (From: Henrique Prange <email@hidden>)
 >Re: Clarification on passing EOs to background threads (From: Paul Hoadley <email@hidden>)
 >Re: Clarification on passing EOs to background threads (From: Jean-François Veillette <email@hidden>)

  • Prev by Date: Re: Clarification on passing EOs to background threads
  • Next by Date: Re: Clarification on passing EOs to background threads
  • Previous by thread: Re: Clarification on passing EOs to background threads
  • Next by thread: Re: Clarification on passing EOs to background threads
  • Index(es):
    • Date
    • Thread