![](https://secure.gravatar.com/avatar/29e40ec843bec4b66414022ddce75718.jpg?s=120&d=mm&r=g)
On Tue, Jul 21, 2009 at 1:50 PM, Ville Voutilainen<ville.voutilainen@gmail.com> wrote:
On Tue, Jul 21, 2009 at 2:33 PM, Ville Voutilainen<ville.voutilainen@gmail.com> wrote:
1) per-thread (in order to avoid synchronisation overhead)
Absolutely. It's like that at this moment.
2) chunked-allocated (set aside a bunch, when all are unwound, remove a chunk, before that, mark them unused for re-use) I don't yet know what would be a proper data structure for 2).
I like that idea. We have no idea about a "normal" stack depth do we? In that case, especially since the overhead of a single pointer seems small, we should probably use a number a bit large (like 4k?), until people start to complain? I think the right structure to use for (2) would be a linked list of arrays. (How about using Conses to store it?)
ArrayDeque would do, but that's java 1.6. Vector would otherwise do, but it's synchronised. I want something like c++ deque, but I'm not sure if it's available in java 1.5.
bye, Erik.