On 18/07/09 14:17, Marc Weber wrote:
>
>> But there is something I don't understand: In main I vim get's the lock 
>> However
> I traced getpid() in main and Python_Lock_Vim.
> Each time the same pid is printed! So I do no longer wonder why I don't
> have to release the lock. However I still wonder why vim does crash
> without the patch because the code is run from within the same thread
> anyway?
>
> Any ideas ?
>
> Marc Weber

IIUC, that doesn't mean anything: the PID is a process ID, not a thread 
ID. Even if you run several threads in parallel, if it's the same 
instance of the executable it's the same process.

This said, IIUC Vim is basically a single-threaded application. Threads 
can (I think) only happen due to interfaces with threaded interpreters.

The src/Makefile includes the following comment, which seems to be 
(partially) outdated:
> # PYTHON
> # Uncomment this when you want to include the Python interface.
> # NOTE: This may cause threading to be enabled, which has side effects (such
> # as using different libraries and debugging becomes more difficult).
> # NOTE: Using this together with Perl may cause a crash in initialization.
> #CONF_OPT_PYTHON = --enable-pythoninterp

I suppose you looked them up too too, but uses of symbols _REENTRANT 
(which is defined on my gcc command-line as shown by :version) and 
_THREAD_SAFE (both in os_unix.c and once together in 
/usr/include/features.h) look like they might be interesting.


Best regards,
Tony.
-- 
Help!  I'm trapped in a PDP 11/70!

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui