I want to create some kind of queue for an app.
The idea is pretty much like this: user starts using the app and gets in line (queue), now the more users that come in, obviously, the more elements I'll have in my queue. Now, I want each element to do "something" in the same order they came in (FIFO, first in first out). The other elements in line won't have access to that "something" until the current thread is over.
I'm not very skilled when it comes to threads, so, what can I do? How can I accomplish this "queue" thing?
Thanks in advance
EDIT: Since it's a server/client app, I can have a sync'd method that does the processing. Now, how can I make threads come in in the same order they were created?
The idea is pretty much like this: user starts using the app and gets in line (queue), now the more users that come in, obviously, the more elements I'll have in my queue. Now, I want each element to do "something" in the same order they came in (FIFO, first in first out). The other elements in line won't have access to that "something" until the current thread is over.
I'm not very skilled when it comes to threads, so, what can I do? How can I accomplish this "queue" thing?
Thanks in advance
EDIT: Since it's a server/client app, I can have a sync'd method that does the processing. Now, how can I make threads come in in the same order they were created?