c++ shared library startup options
3 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone. I have a question regarding compilation of c++ shared libraries and multithreading.
When creating a standalone executable i know that it is possible to specify startup option (i mostly use deploytool)
-singleCompThread
to make sure that each MCR can only have one active computational thread.
As for C++ shared libraries i am not quite sure how this works. If i do not specify anything do the dll enable multiple threads?
and if so, how can i make sure that the shared library only uses one thread?
The project calling the c++ library is going to start several instances at once, and from testing with a standalone executable (and a .bat file) i have found out that the most effective way was to enable hyperthreading on my PC but only allow a single computational thread inside the matlab executable and run 8 instances at once ( i have 4 physical cores that turns into "8" when hyperthreaded ).
I have been searching the web for quite some time now and i cant find any examples that uses -singlecompthread for c++. The closest i got was the function
mclInitializeApplication
is this where -singleCompThread should be specified?
Any tips or clarifications would be highly appreciated as i am not very familiar with C++.
Thx in advance!
0 件のコメント
回答 (1 件)
Kaustubha Govind
2013 年 8 月 19 日
It looks like specifying the -singleCompThread option during compilation should also work.
For example:
>> mcc -R -singleCompThread -mv foo.m
3 件のコメント
Kaustubha Govind
2013 年 8 月 20 日
Ah! Sorry that didn't work. I'm not sure what else to recommend here. If you don't receive any other replies on this forum, you may want to contact MathWorks Tech Support.
参考
カテゴリ
Help Center および File Exchange で Parallel Computing Fundamentals についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!