bugpyFormex - Bugs: bug #41726, multitask hangs when writing...

 
 

bug #41726: multitask hangs when writing surfaces coz of pf.message?

Submitter:  gianluca de santis <gianlucadesi>
Submitted:  Thu 27 Feb 2014 04:57:40 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 28 Feb 2014 09:35:45 AM UTC, comment #2: 

It works for me!
But I found another strange thing:
if there is a draw just before the multitask the multitaks hangs whereas if there is a draw and then a print the multitask works!
In attachment an example.

(file #30732)

gianluca de santis <gianlucadesi>
Group Member
Thu 27 Feb 2014 05:57:10 PM UTC, comment #1: 

multitask creates separate threads that can not communicate with the main thread, running the GUI. That makes sense, because you do not want a process running in the background to mess with your GUI. This means that you should not use functions that change the GUI inside the multitask functions!

However, there are some (maybe many) functions performing tasks that could benefit from multitask, but write something to the GUI (e.g. using pf.message). These should be changed.

In all cases, pf.message should be replaced with print. pf.message writes directly to the message board, while print writes to stdout, which is often redirected to the message board, with the same result. But stdout could be redirected during the multitask execution.

Benedict Verhegghe <bverheg>
Group administrator
Thu 27 Feb 2014 04:57:40 PM UTC, original submission:  

I was not able to run multiple commands in parallel and I realized that the line that was causing the problem was the read surface.
I have attached a short code showing the problem.
The problem is solved if in fileread.py I comment all pf.message(...) !!
Could you check if this also happens to you guys?

gianluca de santis <gianlucadesi>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #30732:  multi_bug2.py added by gianlucadesi (2KiB - text/x-python)
file #30720:  multi_bug1.py added by gianlucadesi (2KiB - text/x-python)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bverheg (Posted a comment)
  • -email is unavailable- added by gianlucadesi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-02-28 gianlucadesi Attached File- Added multi_bug2.py, #30732
    2014-02-27 gianlucadesi Attached File- Added multi_bug1.py, #30720

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code