Results 1 to 4 of 4

Thread: TBEM: internal multiple threads

  1. #1
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,818
    Rep Power
    10

    TBEM: internal multiple threads

    Mike,

    while talking with ISAWHIM about thinBasic Callbacks and other stuff about function pointers, I was thinking about a more generalized TBEM way to check if a an event must be fired.

    Currently for TBEM to properly works, there is the necessity to add a TBEM_Run call in a loop.
    What about if TBEM, on startup, creates an internal thread and use it to internally check about events? Maybe a new keyword like TBEM_InstallThread (or something like that) could be used to instruct TBEM the script wants to go with TBEM internal thread while if no TBEM_InstallThread than TBEM_Run is still valid.

    This method can add a more general use of TBEM and possibly fire events even if main thinCore engine is busy on long execution scripts that will not let the execution cursor return into the main loop and fire a new TBEM_Run. This last part is still to be tested though.

    What do you think?

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  2. #2
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Germany
    Age
    58
    Posts
    3,299
    Rep Power
    348

    Re: TBEM: internal multiple threads

    Well, to be that means less controll in the app. For games I can't see an advantage but maybe there is one for apps.

    But most important, can you secure me that it is possible to run two functions at the same time? I allways understood that you can't run several scripts and so functions in the same environment and at the same time.

    Did I understood it correctly that you want to give an event a flag to either react on TBEM_RUN or to act on the internal thread?

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,818
    Rep Power
    10

    Re: TBEM: internal multiple threads

    I cannot guarantee that it would work 100%

    thinBasic cannot run more than one piece of code at the same time but what it can do is stop execution at the current execution pointer, jump into a new called function and return at the same previous execution pointer. If execution of the called function is quite fast, it can seems to be multi thread even if not.

    I think I will have some spare time in next week-end so maybe I can check possibility to do what is in my head and confirm you if possible or not.
    If I produce some usable code I will send it to you and you will decide.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Germany
    Age
    58
    Posts
    3,299
    Rep Power
    348

    Re: TBEM: internal multiple threads

    ok.

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •