Click here to Skip to main content
15,898,371 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: while(true) is not fun Pin
c6jones72020-Sep-20 22:21
c6jones72020-Sep-20 22:21 
GeneralRe: while(true) is not fun Pin
#realJSOP20-Sep-20 23:52
professional#realJSOP20-Sep-20 23:52 
GeneralRe: while(true) is not fun Pin
glennPattonWork320-Sep-20 23:55
professionalglennPattonWork320-Sep-20 23:55 
GeneralRe: while(true) is not fun Pin
Marc Clifton21-Sep-20 2:58
mvaMarc Clifton21-Sep-20 2:58 
GeneralRe: while(true) is not fun Pin
James Curran21-Sep-20 3:29
James Curran21-Sep-20 3:29 
GeneralRe: while(true) is not fun Pin
trønderen21-Sep-20 4:04
trønderen21-Sep-20 4:04 
GeneralRe: while(true) is not fun Pin
James Curran21-Sep-20 6:06
James Curran21-Sep-20 6:06 
GeneralRe: while(true) is not fun Pin
trønderen22-Sep-20 0:44
trønderen22-Sep-20 0:44 
James Curran wrote:
Most embedded systems still have a "power" switch, which is not hard-wired to the power, but instead, starts the "power-down" procedure
What do you plan to to in this omnipresent "power-down" procedure when there is nothing to save or cleanup? If your code runs multiple threads, each executiong an infinite loop (which is quite common in embedded code), will you broadcast a 'power-down' message to each of these loops and let them all take various terminating actions? Conceptually, almost all interrupt handlers are infinite loops, making another iteration when an interrupt is received. Will you signal the 'power-down' to each handler as well, for them to do their termination handling?

If there are cleanup actions to be done for one, or possibly a couple, of the threads, you should of course send these theads a termination request for orderly shutdown. But lots of embedded threads, or even complete embedded systems, have no cleanup requirements. They have no need for any 'shutting down' signal, but can be cut off without formalities, just like when power disappears.

The CHILL language was specifically designed for embedded systems (specifically: phone switches), and it provided an explicit loop mechanism: 'for ever do ...'. Phone switches are also illustrating that the system as a whole is designed for never terminating. If a phone switch stops running, it is due to an error or other exceptional condition; the code design assumes perpetual running.
GeneralRe: while(true) is not fun Pin
obermd21-Sep-20 3:55
obermd21-Sep-20 3:55 
GeneralRe: while(true) is not fun Pin
trønderen21-Sep-20 4:05
trønderen21-Sep-20 4:05 
GeneralRe: while(true) is not fun Pin
Member 1409260522-Sep-20 21:50
Member 1409260522-Sep-20 21:50 
GeneralOoops. So this should be fun Pin
honey the codewitch20-Sep-20 3:59
mvahoney the codewitch20-Sep-20 3:59 
GeneralRe: Ooops. So this should be fun Pin
OriginalGriff20-Sep-20 4:37
mveOriginalGriff20-Sep-20 4:37 
GeneralRe: Ooops. So this should be fun Pin
Matthew Dennis20-Sep-20 4:40
sysadminMatthew Dennis20-Sep-20 4:40 
GeneralRe: Ooops. So this should be fun Pin
Sander Rossel20-Sep-20 5:04
professionalSander Rossel20-Sep-20 5:04 
GeneralRe: Ooops. So this should be fun Pin
honey the codewitch20-Sep-20 6:08
mvahoney the codewitch20-Sep-20 6:08 
GeneralRe: Ooops. So this should be fun Pin
Sander Rossel20-Sep-20 6:27
professionalSander Rossel20-Sep-20 6:27 
GeneralRe: Ooops. So this should be fun Pin
honey the codewitch20-Sep-20 6:34
mvahoney the codewitch20-Sep-20 6:34 
GeneralRe: Ooops. So this should be fun Pin
Sander Rossel20-Sep-20 6:38
professionalSander Rossel20-Sep-20 6:38 
GeneralRe: Ooops. So this should be fun Pin
honey the codewitch20-Sep-20 6:42
mvahoney the codewitch20-Sep-20 6:42 
GeneralRe: Ooops. So this should be fun Pin
Sander Rossel20-Sep-20 6:47
professionalSander Rossel20-Sep-20 6:47 
GeneralRe: Ooops. So this should be fun Pin
honey the codewitch20-Sep-20 6:49
mvahoney the codewitch20-Sep-20 6:49 
GeneralRe: Ooops. So this should be fun Pin
Sander Rossel20-Sep-20 23:10
professionalSander Rossel20-Sep-20 23:10 
GeneralRe: Ooops. So this should be fun Pin
Nelek20-Sep-20 7:36
protectorNelek20-Sep-20 7:36 
GeneralRe: Ooops. So this should be fun Pin
Sander Rossel20-Sep-20 23:13
professionalSander Rossel20-Sep-20 23:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   408 votes