Package: nproc / 0.5.1-2

Metadata

Package Version Patches format
nproc 0.5.1-2 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
0001 Do not install redundant files.patch | (download)

Makefile | 4 2 + 2 - 0 !
1 file changed, 2 insertions(+), 2 deletions(-)

 do not install redundant files


0002 Retry waitpid if it fails with EINTR.patch | (download)

nproc.ml | 6 5 + 1 - 0 !
1 file changed, 5 insertions(+), 1 deletion(-)

 retry waitpid if it fails with eintr


0003 possible fix for concurrent access to the input stre.patch | (download)

nproc.ml | 11 8 + 3 - 0 !
1 file changed, 8 insertions(+), 3 deletions(-)

 possible fix for concurrent access to the input stream

in the master process, there are threads 1-to-1 associated with
workers. They concurrently try to pull a task from a stream
[in_stream] and send it to a worker, providing a waiter thread for
delivering the output. However it seems that several worker-associated
threads can read the same incoming value in the stream, perform the
computation concurrently and try to send it back to the waiter. Since
the waiter is woken up several times, this generates the exceptions
[Invalid_argument("Lwt.wakeup_result")].

The final result is correct, but ressources are wasted, since some
computation may be several times by several workers (and that really
happens, since the exceptions are raised quite a few times).

The proposed fix is to add a mutex for the access to [in_stream].

0004 slightly more efficient fix for concurrent access to.patch | (download)

nproc.ml | 34 15 + 19 - 0 !
1 file changed, 15 insertions(+), 19 deletions(-)

 slightly more efficient fix for concurrent access to [in_stream]

now each pool has its own mutex.