it notifies the main code when its done

this gives more reuasability of code because the 1st function can be costomised
without modifying the second function

A callback function is a function that is passed as an argument to another function 
and is intended to be called by the other function at a certain point in time. 
When the callback function is called, it can perform a certain action or set of 
actions, depending on what it was designed to do.

You are correct that a callback function can be used in a concurrent or parallel
programming context. However, it is important to note that a callback function is 
not inherently parallel or concurrent on its own, but it can be used in such contexts.

When used in a concurrent or parallel programming context, a callback function is
often used to handle events or tasks that occur asynchronously or in a separate
thread. For example, in a graphical user interface (GUI) application, a callback
function might be used to handle a user interface event, such as a button click 
or a mouse movement.

In a concurrent or parallel programming context, a callback function might be
executed in a separate thread or in a thread pool, depending on the implementation.
This allows the main thread to continue executing while the callback function runs
concurrently, improving the performance and responsiveness of the program.

However, it is important to note that the use of callback functions in concurrent or
parallel programming can introduce some complexities, such as race conditions or 
deadlocks, which must be carefully managed to ensure the correctness and safety of
the program.

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: