Calling multiple functions in parallel

Hello,

I have multiple functions within a shell script. eg. function_database_backup, unix_tar_creation, etc.

I would like to run these functions in parallel, as each is independent of the other.

If these were simple commands, I could have probably run each of the commands in background.

My question is, how can I call multiple functions to execute in parallel in ksh?

Appreciate your help.

Can you have those two functions in two separate file? If so, then you can run first load them and run them at your prompt as commands.

[user@host ~]# cat add2_3.fn
add2_3 () {
    x=$((2 + 3))
    echo x
    sleep 4
    echo "coming out of add fn"
}
[user@host ~]#
[user@host ~]# cat mul2_3.fn
mul2_3 () {
    x=$((2 * 3))
    echo $x
    sleep 5
    echo "coming out of multiply fn"
}
[user@host ~]#
[user@host ~]# . ./add2_3.fn
[user@host ~]# . ./mul2_3.fn
[user@host ~]#
[user@host ~]# add2_3 &
[user@host ~]# mul2_3 &