• Benefits of Asynchronous Programming

    From Wisdom90@21:1/5 to All on Thu Jun 11 21:40:00 2020

    Read this:

    Benefits of Asynchronous Programming

    There are two things which are very important for any application –
    Usability and Performance. Usability because say a user clicks on a
    button to save some data. This requires multiple smaller tasks like
    reading and populating data in internal object, establishing connection
    with SQL and saving it there etc. As SQL runs on another machine in
    network and runs under different process, it could be time consuming and
    may take bit longer. So, if the application runs on a single thread then
    the screen will be in hanged state till all the tasks completes which is
    a very bad user experience. That’s why nowadays many applications and
    new frameworks completely rely on asynchronous model.

    Performance of an application is also very important. It has been seen
    that while executing a request, around 70-80% of the time gets wasted
    while waiting for the dependent tasks. So, it can be maximum utilized by asynchronous programming where once the task is passed to another
    process (say SQL), current thread saves the state and available to take
    another task. When the SQL task completes any thread which is free, can
    take it up further.

    And as you have noticed i have implemented a portable and efficient implementation of a future in Delphi and FreePascal, i think you can
    also use it for Asynchronous Programming, look at GetIsReady() method
    etc. inside the source code to see how to use it for Asynchronous

    You can download my portable and efficient implementation of a future in
    Delphi and FreePascal version 1.06 from:


    Thank you,
    Amine Moulay Ramdane.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)