C++, Python & Threads

VUG plugin at airtel.net
Mon Mar 4 10:23:28 EST 2002


"Martin v. Loewis" <martin at v.loewis.de> escribió en el mensaje
news:m3elj1weyv.fsf at mira.informatik.hu-berlin.de...
> "VUG" <plugin at airtel.net> writes:
>
> > When I launch python console and I create a thread I get a NUMBER
but......
> > This number doesn't the same as the one I get by the function
> > thread.get_ident(). What's wrong in the code?
>
> PyThread_get_thread_ident, having no parameters, always returns the
> thread id of the calling thread. If you want the thread id of the new
> thread, you need to invoke PyThread_get_thread_ident inside of the new
> thread.
>
> BTW, in Python 2.2, start_new_thread does return the thread id of the
> new thread.
>
> HTH,
> Martin
>

Ok. Thanks. I've taking a look at Python 2.2 and it works in the way I need.
But I still having problems. I've embedded Python in my application so I
need to modify Python source. I can't find this source in the Python's Home
page. Isnt't the source code for Python 2.2 available? If not, How can I
modify python 1.6.1 source in order to work the way I need?

Thank a lot
--VUG





More information about the Python-list mailing list