[Python-3000] threading, part 2 (original) (raw)

Guido van Rossum guido at python.org
Wed Aug 16 02:21:27 CEST 2006


On 8/11/06, tomer filiba <tomerfiliba at gmail.com> wrote:

[Guido] > I expect that Jython doesn't implement this; it doesn't handle ^C either AFAIK.

threads are at most platform agnostic (old unices, embedded systems, etc. are not likely to have thread support)

I'm not sure what "platform agnostic" means to you. I think you mean "a platform dependent optional feature"?

so keeping this in mind, and having interruptmain part of the standard thread API, which as you say, may not be implementation agnostic, why is thread.raiseexc(id, excobj) a bad API?

Because it is more general than interrupt_main(). I'm happy to declare the latter a CPython exclusive feature that not all other platforms may support even if they have threads. raise_exc() would have at best the same status; I imagine the set of platforms where it can be implemented is smaller than the set of platforms that can support interrupt_main().

and as i recall, dotNET's Thread.AbortThread or whatever it's called works that way (raising an exception in the other thread), so IronPython for once, should be happy with it.

But Jython?

by the way, is the GIL part of the python standard? i.e., does IronPython implement it, although it shouldn't be necessary in dotNET?

No. Neither Jython nor IronPython have it. But since the presence of the GIL is never directly detectable from Python code, I'm not sure how it could be part of the language standard.

-- --Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-3000 mailing list