Hacker News new | ask | show | jobs
by koakuma-chan 402 days ago
I mean, is it wrong? It seems correct. Unless I'm missing something.
1 comments

Oops, my bad. I seem to have misread. Sorry.
No, a stack is LIFO like it said. A queue is FIFO or in other words LILO “Last In Last Out”.
My last job was at the office. I had my work queue implemented as a stack of files. I would sit at my desk and, in an infinite loop, pop files from my stack and process them. Occasionally, my supervisor would come and push a new file onto my stack. A naive worker would think that, once I was done with my stack, I could finally get some sleep, but no. Our office implemented something called "work stealing," where, once I was done with my own work, I had to visit a random co-worker and pop files from their stack.
No. The LLM's answer is correct.