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

Filling bigarrays may block out runtime #4832

Closed
vicuna opened this issue Jul 3, 2009 · 5 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link

commented Jul 3, 2009

Original bug ID: 4832
Reporter: @mmottl
Status: closed (set by @damiendoligez on 2015-03-17T16:08:23Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.0
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: otherlibs
Monitored by: matt @yallop @hcarty @Chris00 @mmottl

Bug description

Though bigarray data lives on the C-heap, the bigarray fill function does not release the OCaml-lock when overwriting it. This may block out the runtime from handling signals or executing other threads. If a large bigarray is memory-mapped, this can lead to many seconds of unresponsiveness.

@vicuna

This comment has been minimized.

Copy link
Author

commented May 31, 2011

Comment author: @damiendoligez

There is a trade-off between the cost of releasing the lock (which can be too high for small bigarrays) and the latency when not releasing it (which can be too high for large bigarrays).
We should probably release the lock only when the bigarray is bigger than some threshold.

@vicuna

This comment has been minimized.

Copy link
Author

commented May 31, 2011

Comment author: @mmottl

Besides taking the size into account for determining when to release the lock, we should also check whether the bigarray was memory-mapped, in which case the lock should also be released, I think.

@vicuna

This comment has been minimized.

Copy link
Author

commented Jun 11, 2013

Comment author: @mmottl

Btw., this issue also affects the "blit" bigarray function, but apparently no others besides "fill".

@vicuna

This comment has been minimized.

Copy link
Author

commented Jan 30, 2014

Comment author: @mmottl

I have just submitted a pull request for a patch solving this issue to the "official" Github repository here: #4

@vicuna

This comment has been minimized.

Copy link
Author

commented Mar 17, 2015

Comment author: @damiendoligez

Fixed in trunk (rev 15947).

@vicuna vicuna closed this Mar 17, 2015

@vicuna vicuna added the otherlibs label Mar 14, 2019

@vicuna vicuna added this to the 4.03.0 milestone Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.