zsh-workers
 help / color / mirror / code / Atom feed
* MAXJOB
@ 1999-11-05 17:23 Clint Adams
  1999-11-07  7:06 ` MAXJOB Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 1999-11-05 17:23 UTC (permalink / raw)
  To: zsh-workers

What was the reasoning behind hardcoding MAXJOB to 50?
Is there some reason it shouldn't be set to something
hire at compile-time or having it dynamically
relate to a process limit at runtime?

Furthermore, why does MAXJOB 50 result in a maximum
job table size of 48?


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: MAXJOB
  1999-11-05 17:23 MAXJOB Clint Adams
@ 1999-11-07  7:06 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 1999-11-07  7:06 UTC (permalink / raw)
  To: zsh-workers

On Nov 5, 12:23pm, Clint Adams wrote:
} Subject: MAXJOB
}
} What was the reasoning behind hardcoding MAXJOB to 50?

It's a fixed number so that the job table can be statically declared
rather than dynamically allocated.  I've forgotten (or never knew) why
the value 50 was chosen, or whether there's a still-valid reason to
avoid dynamic allocation of the job table.

} Furthermore, why does MAXJOB 50 result in a maximum
} job table size of 48?

The last job table slot is reserved for tracking builtin commands, so
that the whole shell doesn't become unusable when you fill up the rest
of the table with external processes.  It's nice to be able to kill
those runaway background jobs, is it not?

jobtab[0] is also reserved, but it may be for no better reason than to
avoid having to map 1-based user-visible job-numbers to 0-based table
locations.  I don't immediately recall anything else that's being done
with it.

In fact, it may be that 50 was chosen so that the number of job table
entries would *appear* to be a multiple of 8.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-11-07  7:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-05 17:23 MAXJOB Clint Adams
1999-11-07  7:06 ` MAXJOB Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).