home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.parallel
- Path: sparky!uunet!gatech!hubcap!fpst
- From: don@ohm.york.ac.uk (Don Goodeve)
- Subject: Re: Manipulating process workspace on the Transputer
- Message-ID: <1992Nov20.151414.7613@hubcap.clemson.edu>
- Sender: fpst@hubcap.clemson.edu (Steve Stevenson)
- Organization: Electronics Department, University of York, UK
- References: <1992Nov17.132507.14895@hubcap.clemson.edu>
- Date: Fri, 20 Nov 92 14:13:48 GMT
- Approved: parallel@hubcap.clemson.edu
- Lines: 57
-
- In <1992Nov17.132507.14895@hubcap.clemson.edu> aghao@sersun2.essex.ac.uk writes:
-
- >To this I would add that I need this information at run-time. The idea is that
- >there are low-priority processes executing code implemented as functions
- >(A and B, say). Each of these processes would have an associated workspace,
- >pointed to by Wptr, for local vars, params, etc. I need to know exactly what
- >the size of the allocated workspace is, and I would like to design a separate
- >function (G, say), which, executed by a high priority process, would be able to
- >examine, access and manipulate the workspaces for A and B.
-
- The only way that I think you could get this information is from
- the compiler/builder. Tcode is relocatable and hence can be started
- anywhere in memory without modification. However, on startup the
- WPtr and IPtr need to be set (base addresses). You can easily find
- this value if you can ensure that no variables in your code are
- allocated before you do something like
-
- LDLP 0
- STNL address (pass in as a f. parameter)
-
- The top limit is a matter for whatever you are using to do memory
- allocation (icollect in Inmos toolsets). This will depend on the
- requirements of your compiled code and any stuff that you link
- in. I do not know of any way you could determine it at run time.
-
- If you have the available memory, you could always write a bogus
- piece of code that does something like (Occam)
-
- SEQ
- [ridiculously.large.number]INT dud.array :
- PLACE dud.array IN WORKSPACE :
- SEQ
- SKIP -- (may have to be more meaningful to avoid being
- -- optimised out)
- ... Rest of function
-
- This way, you should be able to guarantee the upper limit by
- choosing an appropriate ridiculously.large.number.
-
- Not necassarily the most elegant approach, but it may save
- a lot of hassling around trying to extract the information
- you need.
-
- I dont know what the situation is like for other language
- platforms, but you should be able to do something similar.
-
- Cheers
- Don
-
- don@ohm.york.ac.uk
-
-
- --
- ---------------------------------------------
- | Don --- Well why not? Someone has got to be!|
- ---------------------------------------------
-
-