MCR Shared option in deploytool

조회 수: 3 (최근 30일)
Artik Crazy
Artik Crazy 2011년 8월 27일
Hi everybody!
I have a question about the Matlab deploy-tool. When using it to produce a Java .jar file there is an option, available to check - Object instances share MCR.
What is this option for? When should I use it? I tried to find some answers at the help files, but found nothing useful. Thank you in advance for your help!

채택된 답변

Walter Roberson
Walter Roberson 2011년 8월 28일
According to the documentation,
Shared MCR Instance — When using MATLAB Builder NE, you can create a shared MCR instance, also known as a singleton. The builder creates a single MCR instance for each MATLAB Builder NE component in an application. You can reuse this instance by sharing it among all subsequent class instances within the component. Such sharing results in more efficient memory usage and eliminates the MCR startup cost in each subsequent class instantiation. All class instances share a single MATLAB workspace and share global variables in the MATLAB files used to build the component.
The downside of this is mentioned in a recommendation in a blog:
Don't create or use non-constant static state anywhere (in M, C++ or Java code). Code that uses global variables, for example, will likely yield unexpected results if other applications share the MCR's global resources.
  댓글 수: 1
Artik Crazy
Artik Crazy 2011년 9월 2일
Thank you for your answer!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB Compiler SDK에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by