Hello,
How can i call a function so i can call the code, while the code is running.
what i waht is:
run some code, while the code is running i will run a code async (apart the other code)
Thanks for helping me :)
Printable View
Hello,
How can i call a function so i can call the code, while the code is running.
what i waht is:
run some code, while the code is running i will run a code async (apart the other code)
Thanks for helping me :)
Depends on what you're running asynchronously and for how long.
You can get very limited functionality through alarm() and a signal handler.
alarm(2) - Linux manual page
sigaction(2) - Linux manual page
But bear in mind, what you can call inside a signal handler is very limited. You couldn't call for example printf.
signal-safety(7) - Linux manual page
If it's all I/O that you want to be asynchronous, then perhaps this.
aio(7) - Linux manual page
For full blown do whatever you need async, then go for threads.
pthreads(7) - Linux manual page
I'm working on ubuntu (linux) and Mac OS