9
votes
How much stack usage is too much?
If you allocate an array of say 10,000 bytes on the stack, then that array is limited in size. 10,000 may be a lot, but if you need 10,001 bytes then your program can crash or worse. So in this ...
5
votes
Accepted
How do I prevent stack overflows from happening in this command structure with callbacks?
I have a set of jobs that I need executed.
Excellent. You have chosen a reasonable architecture to meet this need.
When a job is finished, the job uses a callback function to inform the entity of ...
1
vote
How do I prevent stack overflows from happening in this command structure with callbacks?
Don't have a callback. or at least dont pass the job into it.
TaskSet.executeJob(Job j)
{
j.Execute();
//the job has finished
if(j.status == failed)
{
this.Queue.Add(j); //...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
stackoverflow × 12stack × 4
heap × 3
java × 2
programming-practices × 2
recursion × 2
c# × 1
.net × 1
c × 1
data-structures × 1
exceptions × 1
haskell × 1
networking × 1
event-programming × 1
concepts × 1
memory-usage × 1
jvm × 1
callbacks × 1
tail-call × 1