octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #47478] parallel package: parcellfun() hangs w


From: Olaf Till
Subject: [Octave-bug-tracker] [bug #47478] parallel package: parcellfun() hangs when used with @fft2()
Date: Sat, 25 Feb 2017 05:00:59 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #12, bug #47478 (project octave):

Attached a fix, and a test without package 'parallel', printing 3 lines
without and 4 with the fix (child doesn't return due to unrelated problem with
current tip).

Rationale:

Previously, fftw threads, handled by a 'singleton' object, were created only
at first usage of an fft function. If created before fork, child sees threads
have been created, but has only one of these threads. Just recreating the
threads in the child was tried in previous posts but did not work. See 'man
pthread_atfork' for possible problems with mutexes.

The patch uses 'pthread_atfork()' to register functions, which de-initialize
the fftw singleton objects, to be called by the parent before each fork().
Re-initialization, in parent and child, doesn't need to be registered, because
it's handled by the singleton objects.

The patch is a minimal solution. It moves a function from private: to public:.
Or should a new 'atfork_cleanup_list' be created (similar to existing
'singleton_cleanup_list') and the fftw-deinitializer be added to it? Should a
test file be created, which might hang Octave?

(file #39827, file #39828)
    _______________________________________________________

Additional Item Attachment:

File name: reset-fftw-at-fork.cset        Size:3 KB
File name: demo_47478.m                   Size:0 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47478>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]