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

 
 

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

Submitted by:  gianluca de santis <gianlucadesi>
Submitted on:  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

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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>
Project 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>
Project 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)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    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.5