ArduinoProcessScheduler icon indicating copy to clipboard operation
ArduinoProcessScheduler copied to clipboard

Process exiting

Open MarcFinns opened this issue 6 years ago • 15 comments

Hello, Is it possible for a process that has completed its intended course of actions to disable and remove itself somehow, or do I need to implement yet another killer / garbage collector process? thanks!

MarcFinns avatar Sep 04 '17 15:09 MarcFinns

Hi, It is completely valid and safe to have a process call any of the: disable() enable() destroy() restart()

Routines from inside a service routine. In your case destroy() will be the appropriate one to remove itself completely

wizard97 avatar Sep 04 '17 16:09 wizard97

Great! shall I assume that the objet itself will be gone / its memory released? thanks again!

MarcFinns avatar Sep 04 '17 16:09 MarcFinns

It is never recommend to use dynamic memory when programming microcontrollers. If you have created your process object in global space (as you likely have) it will exist on the stack and destroy will not free the memory because it is not dynamic to begin with.

That being said it is possible and supported to use processes that use dynamic memory. Instead of statically allocating your processes, you will have to call new Process.To free itself when it exits, at the very last line of cleanup, you can call delete this. Again, dynamic memory usage is not recommend.

wizard97 avatar Sep 04 '17 16:09 wizard97

I know you are right, but I need to free up memory at some point after certain tasks have been carried out

MarcFinns avatar Sep 04 '17 17:09 MarcFinns

Cool, good luck. Also remember that disable(), enable, destroy(), etc... just sends a signal to the scheduler, and this call will not immediately call the associated routine.

wizard97 avatar Sep 04 '17 17:09 wizard97

Hi Aaron, Just thought to share my project, made possible by your Process Scheduler… Thanks again. m

https://youtu.be/iyFuKU8ZcuA

From: Aaron Wisner [email protected] Reply-To: wizard97/ArduinoProcessScheduler [email protected] Date: Monday, 4 September 2017 at 19:23 To: wizard97/ArduinoProcessScheduler [email protected] Cc: Marcello Fini [email protected], Author [email protected] Subject: Re: [wizard97/ArduinoProcessScheduler] Process exiting (#8)

Cool, good luck. Also remember that disable(), enable, destroy(), etc... just sends a signal to the scheduler, and this call will not immediately call the associated routine.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/wizard97/ArduinoProcessScheduler/issues/8#issuecomment-327005240, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXPSLe-74lTmI6CQODYe1yARPeZkTjnVks5sfDH_gaJpZM4PMCfq.

MarcFinns avatar Jan 15 '18 23:01 MarcFinns

Congrats on finally finishing your project! I had a chance to watch your video, it's very impressive what you managed to acomplish. This is definitely one of the more complicated projects I have seen that have used this library.

Any chance you would be willing to share your code?

wizard97 avatar Jan 22 '18 01:01 wizard97

Hi there, thanks.

I kind of published it in the current state as I have no time to work on it anymore...

The code was started in a semi-proper way, with an OO application framework, but I run into memory issues and I had to take shortcuts.

I even had to make a custom memory mapping (2M code, 2M SPIFFS) to make it fit and retain the OTA capabilities.

I would need a proper IDE to comment / cleanup / refactor but.. no time!

If I see any interest and I find time I might do a sort of instructable.


From: Aaron Wisner [email protected] Sent: 22 January 2018 02:10 To: wizard97/ArduinoProcessScheduler Cc: marcello fini; Author Subject: Re: [wizard97/ArduinoProcessScheduler] Process exiting (#8)

Congrats on finally finishing your project! I had a chance to watch your video, it's very impressive what you managed to acomplish. This is definitely one of the more complicated projects I have seen that have used this library.

Any chance you would be willing to share your code?

You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/wizard97/ArduinoProcessScheduler/issues/8#issuecomment-359299522, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXPSLaTmZB8sDYW9eigLteNWTAHoQlPkks5tM-AbgaJpZM4PMCfq.

MarcFinns avatar Jan 22 '18 08:01 MarcFinns

Forgot..

https://github.com/MarcFinns/AtmoScan


From: Aaron Wisner [email protected] Sent: 22 January 2018 02:10 To: wizard97/ArduinoProcessScheduler Cc: marcello fini; Author Subject: Re: [wizard97/ArduinoProcessScheduler] Process exiting (#8)

Congrats on finally finishing your project! I had a chance to watch your video, it's very impressive what you managed to acomplish. This is definitely one of the more complicated projects I have seen that have used this library.

Any chance you would be willing to share your code?

You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/wizard97/ArduinoProcessScheduler/issues/8#issuecomment-359299522, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXPSLaTmZB8sDYW9eigLteNWTAHoQlPkks5tM-AbgaJpZM4PMCfq.

MarcFinns avatar Jan 22 '18 08:01 MarcFinns

@MarcFinns Try this plug-in for Visual Studio, it's free to use (1 pop-up a day) and integrates well enough to use VS functionalities (indentation, refactor, static analysis, etc..)

GitMoDu avatar Feb 20 '18 15:02 GitMoDu

Here it is! https://www.instructables.com/id/AtmoScan/

From: Aaron Wisner [email protected] Reply-To: wizard97/ArduinoProcessScheduler [email protected] Date: Monday, 22 January 2018 at 02:10 To: wizard97/ArduinoProcessScheduler [email protected] Cc: Marcello Fini [email protected], Author [email protected] Subject: Re: [wizard97/ArduinoProcessScheduler] Process exiting (#8)

Congrats on finally finishing your project! I had a chance to watch your video, it's very impressive what you managed to acomplish. This is definitely one of the more complicated projects I have seen that have used this library.

Any chance you would be willing to share your code?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/wizard97/ArduinoProcessScheduler/issues/8#issuecomment-359299522, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXPSLaTmZB8sDYW9eigLteNWTAHoQlPkks5tM-AbgaJpZM4PMCfq.

MarcFinns avatar Mar 08 '18 20:03 MarcFinns

That is awesome, it looks like you are getting a lot of interest and comments in just a day after showing your project on hackaday. Very impressed what you managed to pull off on just an esp8266!

wizard97 avatar Mar 09 '18 18:03 wizard97

It’s your scheduler...

Sent from my iPhone

On 9 Mar 2018, at 19:48, Aaron Wisner <[email protected]mailto:[email protected]> wrote:

That is awesome, it looks like you are getting a lot of interest and comments in just a day after showing your project on hackaday. Very impressed what you managed to pull off on just an esp8266!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/wizard97/ArduinoProcessScheduler/issues/8#issuecomment-371909581, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXPSLTilQaJZjnb__mlgakpru-lVZGSgks5tcs5hgaJpZM4PMCfq.

MarcFinns avatar Mar 09 '18 18:03 MarcFinns

Imagine what you could do with the ESP32!

wizard97 avatar Mar 10 '18 19:03 wizard97

And some time…

From: Aaron Wisner [email protected] Reply-To: wizard97/ArduinoProcessScheduler [email protected] Date: Saturday, 10 March 2018 at 20:20 To: wizard97/ArduinoProcessScheduler [email protected] Cc: Marcello Fini [email protected], Mention [email protected] Subject: Re: [wizard97/ArduinoProcessScheduler] Process exiting (#8)

Imagine what you could do with the ESP32!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/wizard97/ArduinoProcessScheduler/issues/8#issuecomment-372057508, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXPSLTH-M8uq_xXirhC3kjMyOx0Ab_8Iks5tdCdpgaJpZM4PMCfq.

MarcFinns avatar Mar 10 '18 21:03 MarcFinns