help-octave
[Top][All Lists]
Advanced

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

parcellfun + threads (= hanging processes)


From: Jose
Subject: parcellfun + threads (= hanging processes)
Date: Thu, 11 Oct 2012 18:22:55 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120912 Thunderbird/15.0.1

Hello.

I have two mex function that open several threads each. The first mex function 
gathers data, after which the computations are done in octave in the main 
thread. Then the results are handled by the second mex function, and the loop 
continues.

The data processing is done using the parcellfun. If I use only one process, 
the whole thing works OK. But if I choose more than one octave gets stuck. 

Exploring a bit further I read
http://www.mail-archive.com/address@hidden/msg02141.html
and realized that sometimes there parcellfun leaves a zombies behind and a 
process hanging, as suggested in
http://octave.sourceforge.net/general/function/parcellfun.html

------------Debug lines from parcellfun
parcellfun: 2/2 jobs done
parcellfun: waiting for child process 10246 to close
-------------
address@hidden:~/$ ps aux | grep octave
jose     10224  2.8  0.5 1069480 45260 pts/6   Sl+  18:17   0:01 
/opt/octave/octave/bin/octave
jose     10246  0.0  0.2 872868 22976 pts/6    S+   18:17   0:00 
/opt/octave/octave/bin/octave
jose     10247  0.0  0.0      0     0 pts/6    Z+   18:17   0:00 [octave] 
<defunct>
jose     10292  0.0  0.0  10624   928 pts/10   S+   18:18   0:00 grep 
--color=auto octave
-----------

Finally I read that forking threaded processes is not a good idea
http://www.linuxprogrammingblog.com/threads-and-fork-think-twice-before-using-them
and I assume that this can be the main problem (unless somebody corrects me).

Now I wonder: would it make sense to fork octave BEFORE I start my threads and 
then tell parcellfun to use those forked processes? In that case they would be 
free of the thread stuff. I would appreciate any comments on this before I even 
try. Or maybe there is a better solution...

BR
Jose




reply via email to

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