Page 1 of 1

Identifying TCB owner

PostPosted: Wed Mar 05, 2008 5:21 am
by Phil W

How can I identify the active owner of a specific TCB?

What I am doing is sharing a TCB between two tasks under control of another task. Only one of the sharing tasks can be active at any particular time. They destroy themselves when they are finished.
The controlling task performs some idling functions that are specific to either of the active tasks.
I therefore need a way to identify which of the two tasks is active. I was thinking that I could identify which by examining the TCB. Would this be the best way to do it?


Re: Identifying TCB owner

PostPosted: Thu Mar 06, 2008 9:36 am
by aek
Hmm .. Salvo does not store the name of the associated task, as that's very RAM-intensive (comparatively speaking). You could in theory compare the tFP to the range of addresses that the task spans -- not very pretty.

Probably better to use a tcb extension (Salvo Pro only), and store task-specific data in it. Note that enabling tcb extensions enables them for all tcbs, not just the one you're working with.


Re: Identifying TCB owner

PostPosted: Sun Mar 09, 2008 3:58 am
by Phil W
Thanks aek.

I had thought that the only real way available would be checking the tFP in range. I was just checking.

Luckily I found another way by checking for a particular hardware status unique to either task.

Thanks again.

Phil W