Thread View: comp.sys.amiga.tech
4 messages
4 total messages
Started by Brendon Wyber, C.S.C.
Thu, 22 Nov 1990 01:41
The Pure Bit...
Author: Brendon Wyber, C.S.C.
Date: Thu, 22 Nov 1990 01:41
Date: Thu, 22 Nov 1990 01:41
15 lines
906 bytes
906 bytes
Hi, What exactly is the pure bit for. Many PD programs say that they have their pure bit set and can be made resident, but what does that means since you can set the pure bit on any file? If I was writing a program, what would I have to do so that I can say that it is `legally' pure? Be seeing you, Brendon Wyber Computer Services Centre, b.wyber@canterbury.ac.nz University of Canterbury, New Zealand. "Ph-nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn."
Re: The Pure Bit...
Author: Peter A. Castro
Date: Mon, 26 Nov 1990 18:58
Date: Mon, 26 Nov 1990 18:58
38 lines
2447 bytes
2447 bytes
in article <1990Nov22.142858.9900@canterbury.ac.nz>, cctr120@canterbury.ac.nz (Brendon Wyber, C.S.C.) says:
>
> Hi,
>
> What exactly is the pure bit for. Many PD programs say that they have their
> pure bit set and can be made resident, but what does that means since you can
> set the pure bit on any file?
Yes, you can set the Pure bit, but you shouldn't. There is a real reason
for this bit. The resident command loads a Pure program into memory and
keeps it for reuse. Thus, a Pure program must be re-entrant. I'll give
you an example of what can happen if a program that is not Pure has it's
Pure bit turned on and loaded with resident:
The Manx environment comes with a program called 'ls'. This is not a
Pure program. I turned on the Pure bit, loaded it with resident. Now
for the fun. Open two windows. Type 'ls' in both without hitting return.
Now, hit return in one window and quickly click on the other one and hit
return. The programs start to take a directory, but somethings wrong...
I get filenames from one directory in the other window, and visa-versa.
and for some reason one 'ls' program is looping, and looping on the same
name. If I let them go, I eventually get a Guru. (Kids, don't try this
at home ;-)
>
> If I was writing a program, what would I have to do so that I can say that it
> is `legally' pure?
It must be "re-entrant" code, with no static data.
>
> Be seeing you,
You are Number 6 ?
>
> Brendon Wyber Computer Services Centre,
> b.wyber@canterbury.ac.nz University of Canterbury, New Zealand.
>
> "Ph-nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn."
--
Peter A. Castro INTERNET: peter@dbaccess.com // //|
c/o DB Access Inc. UUCP: {uunet,mips}!troi!peter // //||
2900 Gordon Avenue, Suite 101 FAX: (408) 735-0328 \\ // //-||-
Santa Clara, CA 95051-0718 TEL: (408) 735-7545 \// // ||
Re: The Pure Bit...
Author: Matthew Dillon
Date: Tue, 27 Nov 1990 03:52
Date: Tue, 27 Nov 1990 03:52
39 lines
1927 bytes
1927 bytes
In article <1990Nov22.142858.9900@canterbury.ac.nz> cctr120@canterbury.ac.nz (Brendon Wyber, C.S.C.) writes:
>Hi,
>
> What exactly is the pure bit for. Many PD programs say that they have their
>pure bit set and can be made resident, but what does that means since you can
>set the pure bit on any file?
>
> If I was writing a program, what would I have to do so that I can say that it
>is `legally' pure?
>
>Be seeing you,
>
>Brendon Wyber Computer Services Centre,
>b.wyber@canterbury.ac.nz University of Canterbury, New Zealand.
>
>"Ph-nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn."
The pure bit tells AmigaDOS that the executable is 'residentable' ..
multiple instances can be run using the same code image (i.e. shared
code).
The pure bit is set by the linker (specific example: Lattice's BLink
and DICE's DLink) only when the executable is reentrant in this
fashion. The pure bit should never be set manually, programs that are
not residentable (pure bit not set) but forced resident are unreliable,
even if only one instance of the program is run at a time.
If you are talking about hunks, generally any program that contains a
BSS or DATA hunk is *NOT* residentable and thus not usually pure.
Residentable programs generally allocate their data/bss at run-time.
-Matt
--
Matthew Dillon dillon@Overload.Berkeley.CA.US
891 Regal Rd. uunet.uu.net!overload!dillon
Berkeley, Ca. 94708
USA
Re: The Pure Bit...
Author: Randell Jesup
Date: Wed, 19 Dec 1990 01:10
Date: Wed, 19 Dec 1990 01:10
18 lines
1373 bytes
1373 bytes
In article <dillon.7348@overload.Berkeley.CA.US> dillon@overload.Berkeley.CA.US (Matthew Dillon) writes:
> If you are talking about hunks, generally any program that contains a
> BSS or DATA hunk is *NOT* residentable and thus not usually pure.
> Residentable programs generally allocate their data/bss at run-time.
One (unlikely) exception is a program that has Data segments, but
never modifies the globals (i.e. const data only).
Another would be one that makes new copies of the data segment(s)
for each invocation in the startup, and then all global refs are done
via a register or some other dynamic means.
--
Randell Jesup, Keeper of AmigaDos, Commodore Engineering.
{uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.commodore.com BIX: rjesup
The compiler runs
Like a swift-flowing river
I wait in silence. (From "The Zen of Programming") ;-)
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