Pumpkin, Inc.

Pumpkin User Forums

Identifying TCB owner

If you can't make Salvo do what you want it to do, post it here.

Identifying TCB owner

Postby Phil W » Wed Mar 05, 2008 5:21 am

Hi,

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?

regards
Phil

Phil W
 
Posts: 36
Joined: Tue Jan 14, 2003 12:00 am
Location: penrith nsw australia

Re: Identifying TCB owner

Postby aek » Thu Mar 06, 2008 9:36 am

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.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Identifying TCB owner

Postby Phil W » Sun Mar 09, 2008 3:58 am

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

Phil W
 
Posts: 36
Joined: Tue Jan 14, 2003 12:00 am
Location: penrith nsw australia


Return to Coding

Who is online

Users browsing this forum: No registered users and 2 guests

cron