thread wierdness

anton wilson anton.wilson at camotion.com
Fri Jul 26 14:28:19 EDT 2002


> Instead of the two high-priority threads I thought I created, I see 3
> threads with the PIDs 1374, 1375, and 1376.
>

Ok, I see that python creates an init thread when the first thread is being 
created that sits there and does nothing but loop. That seems very pointless 
although I'm sure there is a reason for this.


> Additionally there is a huge gap in time (multiple seconds) on the 6th line
> when process 1374 was scheduled and the 7th line when it was removed from
> the CPU. This breaks my assumption that python threads will switch every 10
> byte codes. Does anyone have any suggested explanations?
>
> [(1374) (1375) - 778582]
> [(1375) (1374) - 778598]
> [(1374) (1375) - 778618]
> [(1375) (1376) -778678]
> [(1376) (1375) - 778696]
> [(1375) (1374) - 778713]
>
> [(1374) (1376) - 506072]
> [(1376) (1375) - 506107]
> [(1375) (1376) - 506150]
> [(1376) (1375) - 506184]
> [(1375) (1374) - 506213]
> [(1374) 1068 - 506496]




More information about the Python-list mailing list