🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.transputer
1 messages
1 total messages Started by Cai Wen Tong Mon, 16 Jul 1990 10:44
(none)
#760
Author: Cai Wen Tong
Date: Mon, 16 Jul 1990 10:44
66 lines
3189 bytes
A Little Trick on Detecting the Deadlocks by TDS Debugger
---------------------------------------------------------

In TDS manual, it writes that `` A problem arises when a single
processor has deadlock. Then there will be no active process from
which the programmer can inspect channels, and hence jump to the
waiting process.''

Yes, this true. When deadlocks occur, all processes either terminated
or waiting on channel communication, therefore descheduled. The active
process queue is empty. But, for the processes waiting on channels,
their workspace descriptor (wdesc) and instruction pointer (iptr) are
recorded at the places assigned to the channels (ccw). So, if you
inspect channel instead of inspecting ``Run queue'' or ``Time queue'',
you may find out the place which you can jump to.

Consider the following simple example,

         #USE userio
         SEQ
           write.full.string(screen, ``PRESS ANY TO START*c*n'')
           write.full.string(screen, ``and then PRESS c-break*c*n'')
           INT kch:
           keyboard? kch
           CHAN OF ANY c1, c2:
           PAR
             INT x:
             SEQ
               c1! 0                -----(1)
               c2? x
             INT x:
             SEQ
               c2! 0                -----(2)   
               c1? x
         :

Certainly, this program will deadlock. By TDS debugger option ``R''
and ``T'', nothing useful is provided. But, you can use the
option ``I'' to inspect channels (option 9 of option I) from memory 
start address (for T800, it is %48). 

When you scan channels, ignore any invalid iptr and wdesc pair 
(flagged by an asterisk, *). For a low priority process, look for a 
wdesc with byte selector equal to 1. For a high priority process, look
for a wdesc with byte selector equal to 0. Eventually, you will find
out the address assigned to the channel you are looking at.

In my transputer, the channel c2 and c1 are assigned on addresses 
#8000008C and #80000090. And the information displayed are:

           address        Iptr            Wdesc
              .             .               .
           #8000008C    #8000013B        #80000069
           #80000090    #80000132        #8000007D
              .             .               .

Thus, I can use TDS debugger function ``O'' and ``%132, %7D'' pair to
jump to (1), and ``%13B, %69'' to jump to (2).

But, REMEMBER:
``TDS debugger has no intelligence. You must provide the intelligence!''

______________________________________________________________________________
| Wentong Cai,                           | JANET:  wca@uk.ac.exeter.cs       |
| Comp. Sci. Dept., Exeter Univ.,        | UUCP:   wca@expya.uucp            |
| Devon, EX4 4PT, UK. TEL: (0392) 264061 | BITNET: wca%uk.ac.exeter.cs@ukacrl|
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads