#3994: Add support for creating and interrupting process groups
----------------------------------+-----------------------------------------
    Reporter:  hamish             |        Owner:  simonmar    
        Type:  feature request    |       Status:  patch       
    Priority:  high               |    Milestone:  7.2.1       
   Component:  libraries/process  |      Version:  6.12.1      
    Keywords:                     |     Testcase:              
   Blockedby:                     |   Difficulty:              
          Os:  Unknown/Multiple   |     Blocking:              
Architecture:  Unknown/Multiple   |      Failure:  None/Unknown
----------------------------------+-----------------------------------------

Comment(by Favonia):

 Replying to [comment:12 hamish]:
 > interruptProcessGroupOf and create_group sound good.  I'm not to fussed
 about what goes on in System.Posix.Process (as you said it is kind of off
 topic for this change).
 Well, if you want to know the process group id of a process, then you need
 {{{getpgid}}}! Let me rephrase my point again: I think {{{childGrp <-
 getpgid(child)}}} and than {{{killpg(childGrp)}}} is better than
 {{{killpg(child)}}} directly.
 >
 > Are there any situations you would want to interrupt your own process
 group without blocking signals?
 I was worried about SIGINT, FFI and user-defined signal handlers, but
 [http://www.mail-archive.com/glasgow-haskell-
 [email protected]/msg02328.html this post] says I worried too much. :)
 >
 > I am happy to change or remove the suffix.   How is this problem
 normally handled?  If a user of say ghc 6.12.3 upgrades process are they
 expected to upgrade everything that uses the old process package?
 As far as I understand multiple versions can co-exist in Hackage system.
 However we need a significant version bump. Some suggestions are made in
 [http://www.haskell.org/haskellwiki/Package_versioning_policy PVP].
 >
 > The patch already has this in the header runProcess.h ...
 >
 > {{{
 > #define RUN_PROCESS_IN_CLOSE_FDS 0x1
 > #define RUN_PROCESS_IN_NEW_GROUP 0x2
 > }}}
 >
 > We should move these to a simpler header (processFlags.h or something)
 so it can be included in both runProcess.h and Internals.hs.
 Yes, that is what I meant. Even without an extra file, I think it would be
 nice to have named constants in Internals.hs.
 >
 > I did try with getProcessID first, but I could not make it work.  MSDN
 says
 > > The handle must have the PROCESS_QUERY_INFORMATION or
 PROCESS_QUERY_LIMITED_INFORMATION access right.
 > but then it also says
 > > The handle returned by the CreateProcess function has
 PROCESS_ALL_ACCESS access to the process object.
 This sounds like a bug to me. Doesn't {{{PROCESS_ALL_ACCESS}}} imply all
 other rights? Maybe some Windows expert can save us.
 >
 > Suspension would be cool, but should we make that another issue?  I am
 not convinced it will be easy to do this on Win32 (I would be happy to
 proved other wrong with some sample code though).
 After knowing the issues about {{{CreateProcess}}} I lost all my
 confidence. Yes let's do it in another thread, or maybe in a Wiki page
 titled System.Process Reformation.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3994#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to