Newsgroups: comp.sys.transputer
From: andyr@wizzy.com (Andy Rabagliati)
Subject: Re: Process id's with the INMOS C Toolset ?
Organization: W.Z.I.
Date: Fri, 25 Nov 1994 20:13:52 GMT
Message-ID: <CzuAv4.Jz6@wizzy.com>

In article <Cztq48.Fx1@exeter.ac.uk>,
Adam Back <aba@exe.dcs.exeter.ac.uk> wrote:
>
>muenkel@daedalus.tnt.uni-hannover.de (Heiko Muenkel) writes:
>> Is it possible to get a process id (or something similar) for
>> subprocesses in a program written with the INMOS C Toolset to identify
>> the process in subroutines ?
>>
>
>My solution relies on allocating aligned process workspaces.  Each
>process can look at the value of its workspace (stack) pointer and as
>the workspaces (stack space) now start on an aligned region of memory,
>you can work out the start of the workspace region with:
>
>	start = Wptr - Wptr % WORKSPACE_ALIGNMENT
>

Interesting. The solution got me a little further in understanding the
problem - is the idea to have a unique process id for each sub-process ?

In that case the Wptr is a good candidate.

Or is the idea to be able to positively identify which of a number of
calling processes invoked you ? Then you might be able to use the Wptr
of the calling process. Somewhat harder to determine.

Is your % WORKSPACE_ALIGNMENT just an easier way to get the latter ?

If not, what is WORKSPACE_ALIGNMENT for ?

I think I just do not fully understand the problem.

Cheers,     Andy!

