Virtual time alarm 
Author Message
 Virtual time alarm

OK, after hacking up Makefiles and config files, I got python
compiled on HP-UX with thread support (using libdce).
It seems to be able to spin off new threads after I import
the thread module, but python normally exits with a "Virtual time alarm"
error.

Even if I don't load the thread module, a "while(1): print 'Hi!'"
program will stop the interpreter in 5 to 10 seconds with
the same message.

Any clues?

- Yonik

ps: using gcc2.7.2, python1.3 w/tkinter + thread modules, libdce, libc_r



Tue, 27 Oct 1998 03:00:00 GMT  
 Virtual time alarm


Quote:

>OK, after hacking up Makefiles and config files, I got python
>compiled on HP-UX with thread support (using libdce).
>It seems to be able to spin off new threads after I import
>the thread module, but python normally exits with a "Virtual time alarm"
>error.

Following up on my own post...

OK, I made a small hack to get the threaded version of python
working with libdce on HP-UX.  It looks as if the calls to signal
to find the current handlers were not restoring the handlers
correctly for SIGVTALRM (perhaps because of mixing signal & sigaction???)
Anyway, I made the following hack that seems to work.  I may
look into a better fix if I ever need the signal module.

============================================================
*** signalmodule.c.1    Mon May 13 11:49:05 1996
--- signalmodule.c      Mon May 13 13:20:36 1996
***************
*** 262,267 ****
--- 262,270 ----
        PySignal_SignalHandlerArray[0].tripped = 0;
        for (i = 1; i < NSIG; i++) {
                RETSIGTYPE (*t)();
+
+ /* attempted DCE fix. -YCS */
+ if (i == SIGVTALRM) continue;
                t = signal(i, SIG_IGN);
                signal(i, t);
                PySignal_SignalHandlerArray[i].tripped = 0;
============================================================

I was looking into how threading worked, and it looks as if control is
only released momentarily every few lines of python code.  In my
scenario, I have multiple C threads, some of which call python
code.  The python code can also spin off multiple threads.
One potential problem I see is callbacks from python code into
C code.  If the C code does something that blocks or takes a long time
(database calls in my case) no other python scripts will be able to
execute, correct?

Is there any problem with manually releasing the interpreter_lock
at the start of my C code and re-acquiring it before I return?
If that will work, perhaps it should be documented in the
"Extending and Embedding the Python Interpreter" document

Thanks for the help!

- Yonik



Fri, 30 Oct 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to sound alarm after interval of time?

2. Time for a virtual machines newsgroup?

3. Time for a virtual machines newsgroup?

4. Provider Sending Email With A Virtual Face - Sunday Times

5. Execution time for Button/virtual event bindings

6. Virtual Schooling a Virtual Reality?

7. Virtual Schooling a Virtual Reality?

8. virtual method call faster that non-virtual method?

9. Virtual 8086 Mode/Virtual Machine Monitor (VMM)

10. Virtual 8086 Mode/Virtual Machine Monitor (VMM)

11. Bug in time.c (was Time.times problems)

12. time and scheduling (was: bug report: [ #447945 ] time.time() is not non-decreasing)

 

 
Powered by phpBB® Forum Software