As far what I understood is that, multi-threading is a capability we can provide to a single program to run multiple task or code blocks in parallel. For example, a spell checker is running on a separate thread while we are typing in a word doc. It is similar to multi tasking being done but on a single program level.
What asynchronous programming help us to achieve us is to provide the capability to write code in such a manner that it does not block the thread which is currently running the process and executes the rest of the code in a sequential manner. For example if we make a db call to get some data and then perform some operation on the received data. After that some other stuff which is independent is executing. So in order to not block the code flow we can make an async call to db using a call back performing the logical operation on data. And the rest of the code is executing sequentially.
My question is, if we know what dependent and independent task in our program are, can't we simply use concept of multi threading only? Why is this new concept of asynchronous programming is introduced? Like promises, call back in JavaScript or completable future in java. Also completable future was introduced in Java 8. What was being there before Java 8 then?
Please correct me if I am wrong any where in my statement.