What is the difference between synchronous and asynchronous functions?
This probably depends on “who you ask”. Generally, something is Asynchronous when it happens without influence of something else. In the case of functions, they are almost always Synchronous in the sense that a function is called by some part of your code, and you get back to the calling function when the callee finishes. You can use asynchronous calls in some OS’s to read or write data to/from files – This is called “Asynchronous IO”. This works along the principles of: 1. You send a packet off to the filesystem to be written. 2. The write function returns almost immediately. 3. (Optionally) Some other code runs in the application. 4. Application waits on some synchronization object (e.g. a semaphore) for the write to complete. There are plenty of other cases of asynchronous behaviour in computer systems – I’d need more specifics on what you are referring to, if you want more details. To make an asynchronous function synchronous, you’d have to implement the “wait” inside the function,