Is it possible to write a tcl program to test ulimit functionalities,
i am familiar about open files, open processes limits but for stack
size/data size and all say for e.g if 2 MB stacksize is max and 50 mb
data size is max, in that case what could be the logic i could use in
program?..
thanks in advance,...
For data size, a bit [string repeat] (for example) should do the job.
But for stack size, it's good you ask now (with 8.6 as yet
unreleased), because vanilla proc recursion will soon stop consuming
stack the way it used to ;-) This wild magic is called the Non
Recursive Engine aka Stackless Tcl.
-Alex
Any suggestion for "max locked memory (kbytes, -l)" field how about it?
With data size, you can just use [string repeat]. Note that it'll be
working with two bytes per character.
With stack size, in 8.5 you can just do recursive calls while using
[interp recursionlimit] to increase the built-in depth. In 8.6, this
is no longer effective because we've moved to using a (C-)stackless
execution engine - well, there's a C stack still but it doesn't get
very deep - for almost everything, which enables all sorts of
interesting things like tailcalls and coroutines. It also means that
we can run normal scripts in very limited environments, a requirement
that goes way back. Anyway, this makes doing what you want rather
difficult; the best way to defeat it is to use the [time] command to
build up real recursion:
proc reallyRecurse {} {
time { reallyRecurse }
}
We are not about to convert the [time] command to be non-recursive
(it's awkward and not really that important; yielding from inside is
not in the spirit of things either) so that's probably the most
practical suggestion I've got. Oh, and you'll still need [interp
recursionlimit] of course.
Donal.
We don't lock memory in the sense that means (i.e., with mlock(2)) at
all; you'll need to write C code to exercise that.
Donal.
We don't lock memory in the sense that means (i.e., with mlock(2)) at