unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* QUERY: w32 sub process implementation
@ 2007-08-19 19:45 dhruva
  2007-08-19 21:16 ` Jason Rumney
  2007-08-19 22:39 ` Kim F. Storm
  0 siblings, 2 replies; 12+ messages in thread
From: dhruva @ 2007-08-19 19:45 UTC (permalink / raw)
  To: Emacs Devel

Hi,
 In the win32 specific implementation, Emacs creates processes in a
thread. Every sub process of has a corresponding thread in emacs. The
thread entry function is reader_thread which reads a char or accepts a
connection and waits till the char is read by the main emacs
thread/read-eval-print loop.
 Using ASYNC read and registering callbacks in wait, I feel we can
completely do away with threads for sub procs. I would like to have
your views before I start making large changes (in my local copy). If
this is not an area of concern, I could concentrate on other portions.

-dky

-- 
Dhruva Krishnamurthy
Contents reflect my personal views only!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: QUERY: w32 sub process implementation
  2007-08-19 19:45 QUERY: w32 sub process implementation dhruva
@ 2007-08-19 21:16 ` Jason Rumney
  2007-08-20  2:19   ` dhruva
  2007-08-20 15:16   ` Richard Stallman
  2007-08-19 22:39 ` Kim F. Storm
  1 sibling, 2 replies; 12+ messages in thread
From: Jason Rumney @ 2007-08-19 21:16 UTC (permalink / raw)
  To: dhruva; +Cc: Emacs Devel

dhruva wrote:
> Using ASYNC read and registering callbacks in wait, I feel we can
> completely do away with threads for sub procs.
Wil this work on Windows 95/98/ME? According to the MSDN docs,
asynchronous reads have limited support, and it is not entirely clear
from the documentation whether the way we handle process I/O would be
included or not.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: QUERY: w32 sub process implementation
  2007-08-19 19:45 QUERY: w32 sub process implementation dhruva
  2007-08-19 21:16 ` Jason Rumney
@ 2007-08-19 22:39 ` Kim F. Storm
  1 sibling, 0 replies; 12+ messages in thread
From: Kim F. Storm @ 2007-08-19 22:39 UTC (permalink / raw)
  To: dhruva; +Cc: Emacs Devel

dhruva <dhruvakm@gmail.com> writes:

> Hi,
>  In the win32 specific implementation, Emacs creates processes in a
> thread. Every sub process of has a corresponding thread in emacs. The
> thread entry function is reader_thread which reads a char or accepts a
> connection and waits till the char is read by the main emacs
> thread/read-eval-print loop.
>  Using ASYNC read and registering callbacks in wait, I feel we can
> completely do away with threads for sub procs. I would like to have
> your views before I start making large changes (in my local copy). If
> this is not an area of concern, I could concentrate on other portions.

I have had the same idea myself, but didn't pursue it due to the "imminent"
release of 22.1.

It would make the w32 sys_select work much more like the "standard"
select - and at the same time make it handle the write mask (to get
rid of the BROKEN_NON_BLOCKING_CONNECT define in ms-w32.h).

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: QUERY: w32 sub process implementation
  2007-08-19 21:16 ` Jason Rumney
@ 2007-08-20  2:19   ` dhruva
  2007-08-20  3:23     ` Eli Zaretskii
  2007-08-20 15:16   ` Richard Stallman
  1 sibling, 1 reply; 12+ messages in thread
From: dhruva @ 2007-08-20  2:19 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Emacs Devel

Hi,

On 8/20/07, Jason Rumney <jasonr@gnu.org> wrote:
> dhruva wrote:
> > Using ASYNC read and registering callbacks in wait, I feel we can
> > completely do away with threads for sub procs.
> Wil this work on Windows 95/98/ME? According to the MSDN docs,

Could we have a new implementation (and decide at configure time) for
the newer versions on windows only. Just for the sake of
compatibility, do we hold back on improving and simplifying? I agree
we need to support older versions of windows OS but IMHO, should also
move forward.

-dky

-- 
Dhruva Krishnamurthy
Contents reflect my personal views only!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: QUERY: w32 sub process implementation
  2007-08-20  2:19   ` dhruva
@ 2007-08-20  3:23     ` Eli Zaretskii
  0 siblings, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2007-08-20  3:23 UTC (permalink / raw)
  To: dhruva; +Cc: emacs-devel, jasonr

> Date: Mon, 20 Aug 2007 07:49:44 +0530
> From: dhruva <dhruvakm@gmail.com>
> Cc: Emacs Devel <emacs-devel@gnu.org>
> 
> On 8/20/07, Jason Rumney <jasonr@gnu.org> wrote:
> > dhruva wrote:
> > > Using ASYNC read and registering callbacks in wait, I feel we can
> > > completely do away with threads for sub procs.
> > Wil this work on Windows 95/98/ME? According to the MSDN docs,
> 
> Could we have a new implementation (and decide at configure time) for
> the newer versions on windows only.

Configure-time decisions are not a good idea, since Windows binaries
are habitually copied between machines, and because many users install
a precompiled binary distribution from ftp.gnu.org instead of building
from sources.

So any such decisions must be run-time decisions.

> I agree we need to support older versions of windows OS but IMHO,
> should also move forward.

There are still many users of Windows 9x, and we don't want to drop
their support.  Any move forward should not break Windows 9x.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: QUERY: w32 sub process implementation
  2007-08-19 21:16 ` Jason Rumney
  2007-08-20  2:19   ` dhruva
@ 2007-08-20 15:16   ` Richard Stallman
  2007-08-21  8:41     ` Kim F. Storm
  1 sibling, 1 reply; 12+ messages in thread
From: Richard Stallman @ 2007-08-20 15:16 UTC (permalink / raw)
  To: Jason Rumney; +Cc: emacs-devel

There are countries where lots of people use old versions of Windows
because they can copy and install those easily.  So it is useful
maintain the Emacs support for those old versions.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: QUERY: w32 sub process implementation
  2007-08-20 15:16   ` Richard Stallman
@ 2007-08-21  8:41     ` Kim F. Storm
  2007-08-21  9:09       ` dhruva
                         ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Kim F. Storm @ 2007-08-21  8:41 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel, Jason Rumney

Richard Stallman <rms@gnu.org> writes:

> There are countries where lots of people use old versions of Windows
> because they can copy and install those easily.  So it is useful
> maintain the Emacs support for those old versions.

I agree that we shouldn't force anyone to upgrade to newer Windoze versions
to run Emacs.

However, the current implementation of sys_select is sub-optimal and
doesn't support all the features of make-network-process (e.g.
non-blocking connects), so fixing the code as suggested would be
really good.

Does W95/98/ME have a working winsock2 implementation?

If so, I suggest someone try to make the changes and test them on W95/98/ME.

If it works -- great.

Otherwise, it should be possible to keep both the old and the new code
(e.g. by making two sys_select_new and sys_select_old functions, and
choose the right one at run-time.)

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: QUERY: w32 sub process implementation
  2007-08-21  8:41     ` Kim F. Storm
@ 2007-08-21  9:09       ` dhruva
  2007-08-21  9:25         ` Jason Rumney
  2007-08-21  9:18       ` Jason Rumney
                         ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: dhruva @ 2007-08-21  9:09 UTC (permalink / raw)
  To: Kim F. Storm; +Cc: Jason Rumney, rms, emacs-devel

Hi,

On 8/21/07, Kim F. Storm <storm@cua.dk> wrote:
> Otherwise, it should be possible to keep both the old and the new code
> (e.g. by making two sys_select_new and sys_select_old functions, and
> choose the right one at run-time.)

I am planning to just use function pointers (pfn_XXXX). I am sure it
an be handled easily. For now, I will just focus on getting the new
ASYNC implementation working on newer msw and consider porting at a
later point.
Shall I first hack the sys_select and getting rid of threads for sub
processes in the first go?
I will need help in understanding the handling of keyboard and mouse
events (not even sure if sys_select handles them or it is somewhere
else). I can handle all the typical file and IPC related IO but have
no clue regarding UI events.

-dky

-- 
Dhruva Krishnamurthy
Contents reflect my personal views only!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: QUERY: w32 sub process implementation
  2007-08-21  8:41     ` Kim F. Storm
  2007-08-21  9:09       ` dhruva
@ 2007-08-21  9:18       ` Jason Rumney
  2007-08-21 16:30       ` Davis Herring
  2007-08-21 23:24       ` Richard Stallman
  3 siblings, 0 replies; 12+ messages in thread
From: Jason Rumney @ 2007-08-21  9:18 UTC (permalink / raw)
  To: Kim F. Storm; +Cc: rms, emacs-devel

Kim F. Storm wrote:
> However, the current implementation of sys_select is sub-optimal and
> doesn't support all the features of make-network-process (e.g.
> non-blocking connects), so fixing the code as suggested would be
> really good.
>
> Does W95/98/ME have a working winsock2 implementation?
>   

Yes. Cleaning up sys_select to use winsock2 and file handles together in
one select statement can be done separately from async IO. Once that is
taken care of, I think the missing features can be added.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: QUERY: w32 sub process implementation
  2007-08-21  9:09       ` dhruva
@ 2007-08-21  9:25         ` Jason Rumney
  0 siblings, 0 replies; 12+ messages in thread
From: Jason Rumney @ 2007-08-21  9:25 UTC (permalink / raw)
  To: dhruva; +Cc: emacs-devel, rms, Kim F. Storm

dhruva wrote:
> Shall I first hack the sys_select and getting rid of threads for sub
> processes in the first go?
>   
No. They are separate issues. Cleaning up sys_select can be done without
breaking backwards compatibility with Windows 95 etc, and will fix
outstanding bugs. Getting rid of threads for sub processes does not seem
to bring any benefits to me.

> I will need help in understanding the handling of keyboard and mouse
> events (not even sure if sys_select handles them or it is somewhere
> else).

It doesn't. sys_select emulates the standard C library select function
for subprocesses and sockets. The reason for its existence is that with
winsock 1.1, the system select function only handles sockets.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: QUERY: w32 sub process implementation
  2007-08-21  8:41     ` Kim F. Storm
  2007-08-21  9:09       ` dhruva
  2007-08-21  9:18       ` Jason Rumney
@ 2007-08-21 16:30       ` Davis Herring
  2007-08-21 23:24       ` Richard Stallman
  3 siblings, 0 replies; 12+ messages in thread
From: Davis Herring @ 2007-08-21 16:30 UTC (permalink / raw)
  To: Kim F. Storm; +Cc: Jason Rumney, rms, emacs-devel

> Does W95/98/ME have a working winsock2 implementation?

My own answer to this question the last time it came up is at
http://lists.gnu.org/archive/html/emacs-devel/2006-07/msg00673.html
(Short answer: yes, for our purposes.)

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: QUERY: w32 sub process implementation
  2007-08-21  8:41     ` Kim F. Storm
                         ` (2 preceding siblings ...)
  2007-08-21 16:30       ` Davis Herring
@ 2007-08-21 23:24       ` Richard Stallman
  3 siblings, 0 replies; 12+ messages in thread
From: Richard Stallman @ 2007-08-21 23:24 UTC (permalink / raw)
  To: Kim F. Storm; +Cc: emacs-devel, jasonr

    Otherwise, it should be possible to keep both the old and the new code
    (e.g. by making two sys_select_new and sys_select_old functions, and
    choose the right one at run-time.)

I agree that would be ok, assuming that there is no difficulty
with compiling both solutions on all the Windows versions.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-08-21 23:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-19 19:45 QUERY: w32 sub process implementation dhruva
2007-08-19 21:16 ` Jason Rumney
2007-08-20  2:19   ` dhruva
2007-08-20  3:23     ` Eli Zaretskii
2007-08-20 15:16   ` Richard Stallman
2007-08-21  8:41     ` Kim F. Storm
2007-08-21  9:09       ` dhruva
2007-08-21  9:25         ` Jason Rumney
2007-08-21  9:18       ` Jason Rumney
2007-08-21 16:30       ` Davis Herring
2007-08-21 23:24       ` Richard Stallman
2007-08-19 22:39 ` Kim F. Storm

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).