Skip to main content
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 ...
gnasher729's user avatar
  • 47.5k
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 ...
Eric Lippert's user avatar
  • 46.4k
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); //...
Ewan's user avatar
  • 79.9k

Only top scored, non community-wiki answers of a minimum length are eligible