how to run multiple instances of stand alone executable

  • Follow


Hi,
We have created a stand-alone matlab executable and would like to run multiple instances of it on the same machine at the same time.  We've set up separate input and output folders for each instance but currently are unable to run more than one instance at a time.  In general, should this be possible?
0
Reply kennaster (92) 12/16/2010 12:40:25 AM

On 12/15/2010 9:40 PM, AMK wrote:
> Hi,
> We have created a stand-alone matlab executable and would like to
>  run multiple instances of it on the same machine at the same time.
>  We've set up separate input and output folders for each instance but
>  currently are unable to run more than one instance at a time.  In general,
>  should this be possible?

are you really saying if one uses Matlab compiler to build a .exe, then
they can only run one instance of the .exe at a time on the machine?

How exactly are you running them? what error do you get when you try
to 'run' the program again?

May be there is a restriction somewhere build-in, I do not know, I just
find it very strange that there should be such a thing.

--Nasser


0
Reply Nasser 12/16/2010 9:56:00 AM


When I start the sencond instance, this if the part of the code that chokes on the first instance of the stand alone.

[code]
%{
    try
%         [m,d,c,xml] =   bmm_read_xmldts_line2(filename);
        [m,d,c,xml] =   bmm_read_xmldts_line_test_1(filename);
    catch
        fprintf (1,'catch1,');
        pause (3);
        try
%             [m,d,c,xml] =   bmm_read_xmldts_line2(filename);
            [m,d,c,xml] =   bmm_read_xmldts_line_test_1(filename);
        catch
            fprintf (1,'catch2:paused!');pause;
%             [m,d,c,xml] =   bmm_read_xmldts_line2(filename);
        end
    end
%}
[/code]
0
Reply AMK 12/16/2010 2:12:02 PM

AMK <kennaster@gmail.com> wrote in message <1489442040.3413.1292526752630.JavaMail.root@gallium.mathforum.org>...
> When I start the sencond instance, this if the part of the code that chokes on the first instance of the stand alone.
> 
> [code]
> %{
>     try
> %         [m,d,c,xml] =   bmm_read_xmldts_line2(filename);
>         [m,d,c,xml] =   bmm_read_xmldts_line_test_1(filename);
>     catch
>         fprintf (1,'catch1,');
>         pause (3);
>         try
> %             [m,d,c,xml] =   bmm_read_xmldts_line2(filename);
>             [m,d,c,xml] =   bmm_read_xmldts_line_test_1(filename);
>         catch
>             fprintf (1,'catch2:paused!');pause;
> %             [m,d,c,xml] =   bmm_read_xmldts_line2(filename);
>         end
>     end
> %}
> [/code]

I have run multiple instances of the sample compiled binary on both windows and linux with no problems (granted with possibly an older version of the MATLAB Compiler, 2009a).

I suspect you should look at your bmm_read* methods. Make sure one of them is not hogging a file handle causing other instance trying to access it to fail.

You say the code 'chokes'. What exactly does that mean?

Is the code in the try block throwing an exception? If so what exception is being thrown:

  try
    [m,d,c,xml] =   bmm_read_xmldts_line2(filename);
    [m,d,c,xml] =   bmm_read_xmldts_line_test_1(filename);
  catch ex
        fprintf (1,'catch1:%s\n', ex.message);
  end

Or better yet, get rid of the try/catch and let the exception bubble up so you see what the problem is.
0
Reply Rodney 12/17/2010 9:14:05 AM

3 Replies
165 Views

(page loaded in 0.096 seconds)


Reply: