Re: Functions & Procedure runing stak

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hi Greg, I hope you had a good Sunday, mine was to make some tests, so the delay to answer you !

C is not my cup of tea, so I checked two solutions with Eu :

1- I made two functions, the first one increases the stack by the name of the procedure and is called at the entry to all of the concerned procedures. The second is called at the end of the procedures and decreases the stack. As a result at any point of time I have acces to that stack. It works well but as I thought, it cost me 50% more in execucion time !

2- The second solution I tested is similar, I avoided to create the two functions, and I put the short code of them directly in the procedures. So I saved some execution time with a 35% increase.

In my project (acquisition&learning&understanding of natural/human language). I have a few procedures that need to know from where(with the path) among hundreds they have been called, so I can take proper action.

As a simple example, it can be used for an error handling procedure that needs to reset only specific variables depending of the procedures initiated but not terminated correctly. But that stack may also be very usefull to write less hierarchically predetermined code.

It would be great if it was not so time consuming. I believe that stack must exist somewhere in the system don't you think ? And It has to be compilabe !


- Chris

new topic     » goto parent     » topic index » view thread      » older message » newer message


Quick Links

User menu

Not signed in.

Misc Menu