On Sep 12, 2013 3:28 AM, "kans" <mkania...@gmail.com> wrote:
>
> On Wednesday, September 11, 2013 7:46:06 AM UTC-7, ZyX wrote:
> > On Sep 11, 2013 1:27 PM, "Thomas" <wiene...@googlemail.com> wrote:
> >
> > >
> >
> > > On 11 September 2013 00:18, Nikolay Pavlov <zyx...@gmail.com> wrote:
> >
> > >>
> >
> > >> Why do you keep calling it async?
> >
> > >
> >
> > > Referring to the introduction to asynchronous programming linked
below, the patch is an almost asynchronous feature, or at least a
completition of the already existing asynchronous features of vim. With all
the "autocmd-events" we already have the posibillity to run code
asynchronous.
> >
> >
> > > Anyway asynchronous doesn't mean threaded, as far as I know and
referring again to the link. That a two different concepts (which you can
combine if you want).
> >
> > >
> >
> > > http://cs.brown.edu/courses/cs168/f12/handouts/async.pdf
> >
> > Now please show how you can run one sequence of commands interleaved
with the other with this patch. Function that runs with given interval
blocks everything until it completes, same for autocommands. You cannot say
you implement preemptive multitasking if you have to wait for one task to
complete before starting the other. It is not async feature.
> >
> >
> > You can, of course, do some hacks with saving a state, exiting and
resuming, but you will then be forced to *emulate* preemption without any
support from vim. I used to have some simple emulation even without such
patch.
> >
> >
> > Note though that I would really like it merged. But not with the
current name.
> >
> > > --
> >
> > > --
> >
> > > You received this message from the "vim_dev" maillist.
> >
> > > Do not top-post! Type your reply below the text you are replying to.
> >
> > > For more information, visit http://www.vim.org/maillist.php
> >
> > >
> >
> > > ---
> >
> > > You received this message because you are subscribed to the Google
Groups "vim_dev" group.
> >
> > > To unsubscribe from this group and stop receiving emails from it,
send an email to vim_dev+u...@googlegroups.com.
> >
> > > For more options, visit https://groups.google.com/groups/opt_out.
>
> ZyX,
>
> The new patch addresses your criticism apart from changing the name.  I
believe we obey Vim code conventions everywhere.  We have also implemented
a monotonically increasing timer for unix and osx which are the only two
OSes we have on hand.  Otherwise, we fall back to gettimeofday.  Async is
only #defined if gettimeofday exists.

You can take the code from python: since 3.3 it has monotonic() function
defined in C code in time module: pymonotonic function in
Modules/timemodule.c. It has implementation for windows as well. Linux
implementation used CLOCK_MONOTONIC (or, with higher priority, CLOCK_HIRES
which is not mentioned in my clock_gettime man page; I guess there is a
reason for it) without _RAW, though I would write

#ifdef CLOCK_MONOTONIC_RAW
                             CLOCK_MONOTONIC_RAW
#else
                             CLOCK_MONOTONIC
#endif

in function arguments. But it is not as severe as issue with gettimeofday:
you cannot see 2 centuries hop with CLOCK_MONOTONIC, maximum slightly
increased/decreased second duration when NTP daemon does his adjustments.

By the way, two pairs of figure braces may be removed from insert_timeout.
Not that it is required by coding style, but this makes code look better.

> Bram,
>
> We now use long longs for keeping track of the timers.  We have also
documented the new functions and some of their limitations.
>
>
> Please let us know if you have further feedback.
>
> -Matt
>
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
"vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to vim_dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui