Is there some interest in a threadsafe vim ?

6 views
Skip to first unread message

Marc Weber

unread,
Dec 6, 2008, 1:45:31 PM12/6/08
to vim...@googlegroups.com
See my posts at vim-dev.
vim is not yet thread safe. I think that i could be made thread safe
with only some effort.
After adding some locks you could run python threads in the background
and run vim.command(..) without worrying.. Maybe this would also result
in vim.sendCmd which would'n return anything but would'nt block either?

Any thoughts, feelings?
Having this feature would enable writing debugger integrations more
easily. You could also run grep commands or such in the background.
(You can do this now as well but only using client-server AFAIK)

Sincerly
Marc Weber

John Beckett

unread,
Dec 6, 2008, 5:54:34 PM12/6/08
to vim...@googlegroups.com
Marc Weber wrote:
> vim is not yet thread safe. I think that i could be made
> thread safe with only some effort.

I can't tell if you think the effort to make Vim thread safe would be small or
large.

I think it would be large. I would far prefer bugs to be tracked down (thanks
Dominique!), and the TODO list pruned.

Dealing with async events is a nightmare. I would recommend clearly identifying what
problem you are trying to solve, then seeing if an alternative approach is
available.

John

Marc Weber

unread,
Dec 6, 2008, 6:41:30 PM12/6/08
to vim...@googlegroups.com
> I think it would be large.
don't you think that it would be enough to add one global lock and
acquire it
* when processing input actions (mouse / keyboard/ client server)
* when running async commands from python or perl and the like?

Marc

John Beckett

unread,
Dec 6, 2008, 8:22:12 PM12/6/08
to vim...@googlegroups.com

What you say may turn out to be correct (I am often overly cautious). If a simple
patch is possible, it should be reasonably easy to produce a proposal (perhaps
without actual code). I would worry about a patch that touched many different parts
of the source.

John

Charles E. Campbell, Jr.

unread,
Feb 22, 2009, 5:33:36 PM2/22/09
to vim...@googlegroups.com
What I'd like: improving the dlopen() process (see mch_libcall() , line
6127 in os_unix.c).
Currently, every time one does a libcall(), mch_libcall() gets called
and it does a dlopen().
dlclose() is never called.

The result is that one can't use static variables in a shared library,
because it gets loaded
into different places.

I've worked around this difficulty with gdbmgr
(http://mysite.verizon.net/astronaut/vim/index.html#GDBMGR),
an interface between vim & gdb, but its not the easiest thing to do.

Regards,
Chip Campbell

Reply all
Reply to author
Forward
0 new messages