summaryrefslogtreecommitdiffstats
path: root/c_pgms/ping_pong.c
Commit message (Collapse)AuthorAgeFilesLines
* ping_pong: spawn multiple threads, which will do locking on the same fdRaghavendra Bhat2012-01-301-10/+38
| | | | | | | | | | | This patch provides an option for the user to give the number of threds as an argument. Before, ping_pong functionlity (i.e. locking the byte range) was done in a separate single thread. With this patch depending upon the input argument, multiple threads will be spawned all of which will try to do the locking using the same fd. Change-Id: Ib68bef407d75351664a76e81474814bd703d285c Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
* ping_pong: allocate the memory from heap instead of using the stack addressRaghavendra Bhat2012-01-131-4/+10
| | | | | | | | | | Currently the stack address of the structure which holds information about the number of locks, fd etc is passed to the thread doing the locking. Instead of sending the stack address, allocate memory from the heap and use that address to send to the other thread. Change-Id: I417e22aee0eed1fa921982e78239147553886786 Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
* c_pgms/ping_pong: validate the arguments given properlyRaghavendra Bhat2011-09-211-6/+65
|
* c_pgms/ping_pong: changes in ping_pong for giving running time as an argumentRaghavendra Bhat2011-09-211-0/+206
ping_pong used to run indefinitely before. Now the locking functionality is made to run in a separate thread and the main thread sleeps for the number of seconds specified as a command line argument. By default it runs for 600 seconds.