delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/06/16/02:06:03

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Wed, 16 Jun 2004 02:05:23 -0400
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Ctrl-Z fails to suspend Windows programs
Message-ID: <20040616060523.GA24441@coe.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <87n035b3kn DOT fsf AT eu DOT citrix DOT com> <20040615120142 DOT GA30776 AT trixie DOT casa DOT cgf DOT cx> <40CEED71 DOT 7020407 AT luukku DOT com> <20040615131311 DOT GB30776 AT trixie DOT casa DOT cgf DOT cx> <40CFD6E5 DOT 1070709 AT luukku DOT com>
Mime-Version: 1.0
In-Reply-To: <40CFD6E5.1070709@luukku.com>
User-Agent: Mutt/1.4.1i

On Wed, Jun 16, 2004 at 08:13:09AM +0300, Jani tiainen wrote:
>Christopher Faylor wrote:
>>On Tue, Jun 15, 2004 at 03:37:05PM +0300, Jani tiainen wrote:
>>
>>>Christopher Faylor wrote:
>>>
>>>>On Tue, Jun 15, 2004 at 09:58:16AM +0100, John Cooper wrote:
>>>>
>>>>>Is it a known limitation that "native" Windows programs cannot be
>>>>>suspended?
>>>>
>>>>Yes.  Window programs do not understand cygwin signals.
>>>
>>>Thats true for cygwin part.  Native programs still can be
>>>suspended/resumed but not by cygwin (or shell that is running and
>>>waiting finishing of active process).
>>
>>
>>It is true for any part that Windows programs do not understand cygwin
>>signals.
>>
>>There is no way to reliably suspend a Windows programs.
                     ^^^^^^^^
>
>Yes there is ( piece of pseudo code):
>
>For Each Thread THREAD_Y in Process PROCESS_X
>	Call_Win32API SuspendThread(THREAD_Y.Handle)
>Next
>
>NOTE: In Win2k and later you need THREAD_SUSPEND_RESUME rights for 
>particular thread.

I do have a fair amount of experience in this area.  SuspendThread
cannot be used to *reliably* suspend a native windows app.  If you
suspend the program at the wrong time you get hangs and other unwanted
behavior.
--
Christopher Faylor			spammer? ->	aaaspam AT sourceware DOT org
Cygwin Co-Project Leader				aaaspam AT duffek DOT com
TimeSys, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019