Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes in tight loops #13

Open
jankap opened this issue Jan 14, 2022 · 0 comments
Open

Crashes in tight loops #13

jankap opened this issue Jan 14, 2022 · 0 comments

Comments

@jankap
Copy link

jankap commented Jan 14, 2022

First thank you very much for this awesome package.

I'm trying to run the stuff in performance.m and unfortunately, the first test fails. Could have to do with the JIT compiler of Matlab:

>> k=1;while(true), [q,r] = jl.call('divrem',7,3); k=k+1; end
Array indices must be positive integers or logical values.

Error in jl.mex (line 23)
            [err, varargout{1:nout}] = mexjulia('jl_mex', fn, varargin{:});

Error in jl.callkw (line 52)
            [varargout{1:nargout}] = jl.mex('Mex.jl_call_kw', fn, int32(npos), varargin{:});

Error in jl.call (line 59)
            [varargout{1:nargout}] = jl.callkw(fn, -1, varargin{:});

Using dbstop if error reveals, that the value of k differs a lot, sometimes it's in the range of 40, sometimes 10000. But it crashes. Is some kind of locking neeeded?

Thanks!

edit 1:
try, k=1;while(true), [q,r] = jl.call('divrem',7,3); pause(0.1), k=k+1; end, catch E, E, k, end always returns k=50 on my machine, regardless of the value in pause().

edit 2:
tic; for i=1:2000; [q,r] = divrem(7,3); end; elpsd = toc; always works. Is there something wrong with jl.call?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant