[pypy-dev] Unable to translate locks

Marek Paška paskma at gmail.com
Tue Jul 29 12:55:33 CEST 2008


Hi, PyPy hackers,

I am playing with Python translation to C, especially with threads. I
am using start_new_thread function provided by
pypy.module.thread.ll_thread. My example (see mytasks.py in
attachment) works fine. But when I tried to use locks (provided by the
same module), I got an exception during the translation (see
mytasks_err.py for the source code and translation_trace.txt).

End of the trace:
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/c/database.py",
line 156, in getcontainernode
[translation:ERROR]     node = nodefactory(self, T, container, **buildkwds)
[translation:ERROR]    File
"/home/data/opt/svnpypy/vanilla-dist/pypy/translator/c/node.py", line
860, in opaquenode_factory
[translation:ERROR]     raise Exception("don't know about %r" % (T,))
[translation:ERROR]  Exception: don't know about <struct
RPyOpaque_ThreadLock (opaque)>

I have no idea whats the problem, translation of pypy interpreter with
thread module enabled works perfectly. Maybe it is caused by the fact
that pypy interpreter uses some special annotation policy, is it
possible?

Please, I would be thankful for any suggestions/comments what to do to
make the locks work.

Marek Paška
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mytasks.py
Type: text/x-python
Size: 338 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20080729/36582f73/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mytasks_err.py
Type: text/x-python
Size: 403 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20080729/36582f73/attachment-0001.py>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: translation_trace.txt
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20080729/36582f73/attachment.txt>


More information about the Pypy-dev mailing list