Threading + embedding = System Dump.

Arinté shouldbe at message.com
Tue Jun 27 11:35:49 EDT 2000


> That sounds very much like there is no multithreading.
>
> So why doesn't "diz[0].write(mx)" block? Or does it?
It doesn't need too.  The data is queued in a seperate subsystem.  My app
only cares if the subsystem couldn't receive the data, so the response is
quick no need to block.  This specific \x1b\x47 command tells when the
device actually finished, I don't always want to wait for that .

>
> Is the real problem here that you're using one of the PyRun_ calls when
you
> need to go down a level and use PyImport_ etc. so the C++ has some control
> over what's going on?
Seemed like I can only run a script once.  If I tried to run the same script
two times in a row the second time it did nothing, all the import calls
return successfully both times.  I don't Py_Finalize until the dll is
unloaded.

I really appreciate your help, but I think I will need to figure something
else out.  I don't know what else to say, that could further explain my
problems, short of posting my whole program.  Which is of moderate size (dll
<100K, app <200K), but no comments.  I didn't expect many others to look at
the code solo/self made project.  I know I still need comments =-(.

Why, is it that if use python Event.wait function, the app crashes, as
oppossed to popping up a messagebox and manually closing that box when I see
the message come thru?  Does wait shut down the thread the script is running
on in some sense?  I would try to do a notify from c++ on the python Event,
but it seems I can't get any access to python when it is in the wait state?

I am currently, tossing around the idea of python call a C++ function called
wait, then in the call back in calls the C++ function notify, and at that
point using a Windows Event I will allow the wait function to return.  I'd
much rather use python's wait, so I won't have to worry about recompiles,
but I don't know what to do to get this working.

thanx again.
Hopefully this is the last, I think I am trying to do too much.





More information about the Python-list mailing list