• 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
Locking non default editing contexts in a multithreaded application?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Locking non default editing contexts in a multithreaded application?


  • Subject: Locking non default editing contexts in a multithreaded application?
  • From: "Nicolas Cassoni" <email@hidden>
  • Date: Thu, 8 Apr 2004 10:12:37 +0200

Hello list,

Although we have read several threads on the topic as well as the available
documentation, one aspect is still unclear.

Indeed, we have an EOEditingContext at the Application level of our app. Our
app responds to direct actions and does quite a few things among which
fetching data in this editing context. It is as if we had a shared
EOEditingContext but with the possibility to write.

Now, the obvious and simple way to handle the locks is to lock when we receive
the direct action and unlock when we return the answer.
Unfortunately, this is a very unefficient way to handle the problem and
defeats the advantage of handling multithreaded requests. Indeed, not all of
the time is spent modifying the editing context.

So... where can we or should we lock?

We could imagin locking each time we call the EOEditingContext to fetch some
objects. But this doesn't handle the problem of a fault firering any time in
our request.

We imagined we could trap some delegated methods or notifications to handle
the lock / unlock. Something like "editingContextWill Change" and
"editingContextDidChange" would be great... simply lock then unlock in those
methods!

Any idea on how to solve the problem? The problem IS a problem as we manage to
easily deadlock our app, unless we implement the global lock/unlock at the
request level (which is an unacceptable solution for us as some parts of the
requests may take seconds independently of editing context access).

Thanks for any help,

Nicolas

--------------------------------------------------------
Nicolas Cassoni
Htpitaux Universitaires de Genhve
Service d'Informatique Midicale
Tel  +41 22 372-7566
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Locking non default editing contexts in a multithreaded application?
      • From: Jonathan Rochkind <email@hidden>
    • Re: Locking non default editing contexts in a multithreaded application?
      • From: Travis Britt <email@hidden>
  • Prev by Date: EOF Design Questions
  • Next by Date: Re: UTF-8 in generated e-mails?
  • Previous by thread: EOF Design Questions
  • Next by thread: Re: Locking non default editing contexts in a multithreaded application?
  • Index(es):
    • Date
    • Thread