Vim itself is single-threaded. But there are some exceptions or workarounds:
- Python threads are working, though not on ARM for some reason. I can’t say though I can predict what would happen if you run
vim.*
method from non-main thread. I saw it used in some plugins, but withoutvim.*
in threads. - Python multiprocessing module is working perfectly (though you will want to disable all vim signal handlers). I personally use this solution in my aurum plugin. I guess ruby equivalent will work, but AFAIR it is just a
fork()
call with simple bytes pipe as the only communication, nothing so complicated asmultiprocessing.Pipe
(pipe that passes a limited set of python objects),multiprocessing.Queue
(wrapper around a pipe that implements objects queue),multiprocessing.Value
(shared memory storing fixed-sized values with object interface) ormultiprocessing.Lock
(dunno what it is, but name says for itself about the purpose). At least not in standard library or core.
AFAIK some older ruby versions used green threads thus (from the OS point of view) were single-threaded while newer ruby is now using POSIX threads. You can try to update, maybe this will work. Though you’d better choose something other as the test (like modifying some variable in a separate thread), not a thing that calls vim. Any current python version you can find on users systems is using POSIX threads, this may be the root of the reason why ruby threads do not work while python ones do.