Re: GCIC Fullscreen applications

"kerravon86" <kerravon86-/[email protected]>
Newsgroups gmane.comp.emulators.hercules390.vm
Message-ID <[email protected]>
--- In [email protected], "Joe Monk" <joe.monk@...> wrote:
>
> How is the sort function supposed to work in a 
> multi tasking envrionment, if
> it cant be *arbitrarily* reentrant?

Unless you have some sort of really whacky
"sort" algorithm in mind, "sort" will be given
a data block from the caller, operates on it
immediately, and doesn't need to store state
information into global variables.

If you went out of your way to be obnoxious,
by perhaps having a:

static int pivot;

int qsort(...)
{
   pivot = (i + j)/2;
}

or whatever, then it would not be naturally reentrant
and thus not work in a multitasking environment.

So you can't just guarantee to make any bit of C
code reentrant. If you want to do that, you need
another tool (a prelinker) and it needs to be a
main C program too, I think, and we don't have that
technology yet.

However, in the case in question - where a sort
was required - I went and deliberately checked
qsort in PDPCLIB and found no such "obnoxious"
coding, therefore it should work fine.

BFN.  Paul.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.