[GRASS-dev] [GRASS GIS] #2253: WinGRASS doesn't allow to close console window

GRASS GIS trac at osgeo.org
Fri May 23 12:24:26 PDT 2014


#2253: WinGRASS doesn't allow to close console window
---------------------------------------+------------------------------------
 Reporter:  martinl                    |       Owner:  grass-dev@…              
     Type:  defect                     |      Status:  new                      
 Priority:  blocker                    |   Milestone:  7.0.0                    
Component:  wxGUI                      |     Version:  svn-trunk                
 Keywords:  wingrass, terminal window  |    Platform:  All                      
      Cpu:  Unspecified                |  
---------------------------------------+------------------------------------

Comment(by glynn):

 Replying to [comment:5 annakrat]:
 > So it seems that r60429 solves the problem, it makes the thread a daemon
 thread. I am not sure if there can be any negative consequences of it.

 The Python interpreter terminates when there are no non-daemon threads
 alive. Any remaining daemon threads will be killed at that point. Note
 that sys.exit() simply raises a !SystemExit exception; if not caught, the
 calling thread (and only the calling thread) will be terminated.

 Whether there are negative consequences to making other threads daemon
 threads would depend upon what those threads were doing at the time. If
 they need to complete a pending operation or perform clean-up, they won't
 get the opportunity.

 Threads which can't safely be killed at any time shouldn't be daemon
 threads. They should have some mechanism by which they can be instructed
 to terminate in an orderly manner. One option is to have the main thread
 instruct such threads to terminate when it is about to terminate (whether
 normally or upon an exception, including !SystemExit). Another option is
 to have the additional threads periodically check whether the main thread
 is alive, and terminate if it isn't.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2253#comment:6>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list