Changes

Jump to navigation Jump to search
1,362 bytes added ,  07:03, March 25, 2021
Line 203: Line 203:  
===Pragmas/Directives===
 
===Pragmas/Directives===
 
Pragmas (aka directives) provide a way of changing options associated with a compiler.  For instance, a pragma may alter the memory alignment of data.  Conditional compilation is also provided by directives that enable or disable the inclusion of code depending upon external conditions (such as the platform that the program is being compiled upon).
 
Pragmas (aka directives) provide a way of changing options associated with a compiler.  For instance, a pragma may alter the memory alignment of data.  Conditional compilation is also provided by directives that enable or disable the inclusion of code depending upon external conditions (such as the platform that the program is being compiled upon).
 +
 +
===Synchronous vs. Asynchronous===
 +
Most programs operate in a synchronous manner: each statement is executed before the next statement is executed.  However, some languages have asynchronous abilities built into the language (such as Node.js) or there are optional libraries that can provide asynchronous behavior for other languages.  An asynchronous program is one that executes more than one statement concurrently.  The mechanism that provides the ability is sometimes called co-routines or, more often, threads.  A synchronous program is "single-threaded", while an asynchronous program is "multi-threaded".  Multiple threads can execute in parallel which can provide a performance benefit if used correctly.  For instance, while one thread is accepting input from the user, another thread can be writing data to a file, and yet another thread can be calculating the display of graphics.  Such an approach cannot be accomplished with synchronous code since each of these tasks must complete before the next one can start.
 +
 +
Multi-threading can provide benefits, but it also requires far more thought in program design, the use of exclusivity mechanisms (such as mutexes, spinlocks, and/or critical sections) to protect data from being updated at the same time by multiple threads, and multi-threaded code can be exceedingly difficult to maintain and debug.
    
==Prescient Quotes on Police State Programming Surveillance==
 
==Prescient Quotes on Police State Programming Surveillance==
SkipCaptcha
292

edits

Navigation menu