BSP for AT91SAM9263-EK
Eric Norum
wenorum at lbl.gov
Tue Sep 7 19:12:10 UTC 2010
On Sep 7, 2010, at 11:58 AM, Thomas Doerfler (nt) wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Eric,
>
> Am 07.09.2010 20:54, schrieb Eric Norum:
>> The interleaved values don't seem unreasonable -- the interrupt-driven console output will block thus giving the scheduler a chance to do a context switch. The polling driver won't do this so the output doesn't interleave.
>
> in general I agree. It can happen that the output of verious tasks
> intermix in interrupt mode.
>
> But: What confuses me in the output is that this intermix happens on a
> per character basis. I would expect that it happens with longer chunks
> coming from one task, then from the next etc.
Scenario:
1) Task one calls write() as a result of calling printf and thereon through the termios stuff to the console file descriptor. This calls the console output routine which sends a character.
2) Task one tries to send another character -- the UART is busy so the task blocks.
3) Task two gets context switched to be the running task
4) Task two does the same steps 1 and 2.
So the interleaving can happen pretty much anywhere in the output strings once all the tasks are started up and runnable and actively doing their write()s.
--
Eric Norum
wenorum at lbl.gov
More information about the users
mailing list