Concurrency. Immutable data structures help in that environment -
nothing special about stacks in that regard.
Yes, granted, but we don't have any evidence the OP is doing any
concurrency. Jan (the OP) has put the cart before the horse, so to
speak. He's asking for programming solutions, when the problem domain
isn't clear.
All we have is some vague assertion that his friend has used an
immutable something or other (stack? queue? Jan seems unclear on it) and
that it's "faster." Why is it faster? Who's measuring? How? Jan
admits he hasn't seen the code. I'd bet money his friend's algorithm is
in fact doing nothing like what Jan supposes.
Jan seems educated, and often poses interesting problems, but at the
same time he also seem blithering, and frequently confuses concepts that
have nothing to do with each other, or leaps to irrelevant conclusions.
It's all a load of old pisswiffle if you ask me.