Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Correct usage of CDOView in a multithreaded application
[CDO] Correct usage of CDOView in a multithreaded application [message #1760449] Thu, 27 April 2017 12:38 Go to next message
Robert Schulk is currently offline Robert SchulkFriend
Messages: 144
Registered: July 2015
Senior Member
Hi all,

our application is running quite well with CDO, but still, we are aiming to optimize the performance in terms of server access and client memory usage.

Our current approach is to open a separate CDOView within each part of our implementation. I would guess, that there may be as many as 10 views accessing the same data via different CDOView instances.

Now my questions would be:

1. Does each view create its own cached objects, or does CDO share data among views.
2. Is it thread-safe to pass a global view object to multiple threads or should we strictly open a new view for each thread?
3. (If the answer to 2 is "not thread-safe"): can we access objects loaded by a view from Thread1 within Thread2, or should we open these objects from a separate CDOView within Thread2?

Thanks!
Re: [CDO] Correct usage of CDOView in a multithreaded application [message #1760525 is a reply to message #1760449] Fri, 28 April 2017 05:32 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Robert Schulk wrote on Thu, 27 April 2017 14:38
1. Does each view create its own cached objects, or does CDO share data among views.


Yes, each view maintains its own set of objects. These object are thin wrappers, though. Their model data (CDORevisions) is shared across all views of a session.

Robert Schulk wrote on Thu, 27 April 2017 14:38
2. Is it thread-safe to pass a global view object to multiple threads or should we strictly open a new view for each thread?


CDOViews and CDOTransactions are generally thread-safe and can be shared across application components. With transactions it usually makes no sense, though, because it would be hard to decide what component executes a commit or rollback.

Cheers
/Eike


Re: [CDO] Correct usage of CDOView in a multithreaded application [message #1760532 is a reply to message #1760525] Fri, 28 April 2017 06:55 Go to previous message
Robert Schulk is currently offline Robert SchulkFriend
Messages: 144
Registered: July 2015
Senior Member
Thanks, that's great!

This also matches our observations, since some objects already leaked to other threads Smile.
Previous Topic:Name attribute
Next Topic:EMF: thread safety for read only access to an EMF resource
Goto Forum:
  


Current Time: Fri Apr 26 08:13:40 GMT 2024

Powered by FUDForum. Page generated in 0.03659 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top