How to make C program wait (on Linux)?

2019-02-13 23:50发布

How to make C program wait (on Linux)? (I need to use wait with MPI - I need C code please)

标签: c linux wait mpi
4条回答
老娘就宠你
2楼-- · 2019-02-14 00:30
老娘就宠你
3楼-- · 2019-02-14 00:33

If you want to wait for a MPI request use MPI_Wait: http://www.manpagez.com/man/3/MPI_Wait/

If you want to wait a certain amount of time use sleep: http://www.manpagez.com/man/3/Sleep/

If you want to wait another process to end use waitpid: http://linux.die.net/man/2/waitpid

If you want to wait a condition variable (multi-threaded programming) use pthread_cond_wait: http://www.opengroup.org/onlinepubs/007908775/xsh/pthread_cond_wait.html

Define what you want to wait for.

查看更多
Explosion°爆炸
4楼-- · 2019-02-14 00:35

Use MPI_Recv, and use MPI_Send to send a message to the waiting process when it should continue.

查看更多
趁早两清
5楼-- · 2019-02-14 00:54

Wait for what exactly ? If you just want a delay use sleep().

查看更多
登录 后发表回答