Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Executing 2 functions simultaenoulsy

BondfireBondfire Member Posts: 28
Hi there,

Is it possible to execute 2 functions simultaenously...at EXACTLY
the same time? If i do 2 function calls:

Function1();
Function2();

then the functions will be executed one after another...is there any way i can execute them at the same time? perhaps thru some sort of parallel computing or function overloading?

Thanks

Bondfire

Comments

  • rollerolle Member Posts: 115
    : Hi there,
    :
    : Is it possible to execute 2 functions simultaenously...at EXACTLY
    : the same time? If i do 2 function calls:
    :
    : Function1();
    : Function2();
    :
    : then the functions will be executed one after another...is there any way i can execute them at the same time? perhaps thru some sort of parallel computing or function overloading?
    :
    : Thanks
    :
    : Bondfire
    :
    [green]By using threads or different processes these functions can execute "more or less" simultanously. IPC mechanisms like events or mutexes can be used to make the threads/processes wait until both are ready to do their work. Likewise, when the two functions have completed their work, IPC can be used to synchronise that they "wait for each other".

    [b]But there's no way to guarantee that they execute it (quote) [blue]"at EXACTLY the same time"[/blue][/b].

    In the end, its always up to the scheduler of the OS to give time slices to the threads/processes or even processors if you're running with multiple CPU's.[/green]
Sign In or Register to comment.