Weird pointer errors... Stackless problem? PyString_InternInPlace Fatal error

Christian Tismer tismer at appliedbiometrics.com
Mon Sep 18 12:51:23 EDT 2000


Mike Fletcher wrote:
> 
> Would _love_ to be able to send the code, but letting someone outside the
> company see this particular code (research results involving long-range
> strategy) would involve enough lawyers and managers that I'd have time to
> rebuild the system 10 times before I got permission.  Ah to work in Open
> Source.
> 
> Okay, lets see if I understand this:
> 
> System Thread <os thread>
>         uthreadLock = 0 or 1, determines whether switches can occur, is a
> global variable effectively.  Assumed to be protected because when it's set,
> no other uthread can be active.  Guarantee fails when a thread is blocked,
> as there's no storage/retrieval of the lock state performed by uthread9's
> scheduler
> 
> uthread9
>         says uthreadLock = 1 # lock
>                 runs function
>                         # function suspends (blocks)
>                         # scheduler runs, clears lock
> 
> ### TIME PASSES, THINGS CHANGE
>                         # thread unblocks
>                         # uthreadLock = unlocked, since running scheduler
>                         # chaos strikes if something really needed that lock

Well, that's the point.
The lock is meant for switching auto-scheduling on and off.
Nobody should assume ownership when scheduling is done.
The lock should be used to perform atomic actions.
This is especially doing things in synchronous, blocking
mode. Atomic means that no other thing can happen meanwhile.

No, if I set the lock, and then call something that runs
the scheduler, this assumption is of course broken.

Do you remember machine code? I had really those simple
cli/sti instructions in mind, in order to protect
a critical section. I'm not aware if uthread9 treats
it this way, or if other assumptions are made.

Still, this all doesn't allow me to crash, and I hope
to find time for some investigation, soon.

cheers - chris

-- 
Christian Tismer             :^)   <mailto:tismer at appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaunstr. 26                  :    *Starship* http://starship.python.net
14163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     where do you want to jump today?   http://www.stackless.com



More information about the Python-list mailing list