For our load testing , we are using stubs (unix shell script) which send the response to the request coming from the application. As the unix stub is single threaded , it is responding to only one request whereas multiple requests come in parallely.
I haven't worked on thread concepts till now. Would like to know if multithreading can be achieved in shell script for e.g if i start up the shell script process, multi thread can handle the parallel requests coming in and send response parallely.
Would be fo great if sample code snippet is given. Thanks in advance.
In the output file - i could see the values written only for the 1st iteration but not for the subsequent iteration.
Does this mean the shell is non-POSIX compliant? or how to test whether it is POSIX compliant and whether it works for the sample script.
Does my sample program makes any sense for testing this functionality and if it is how to confirm that multi-threading is acheived using a sample script?
Last edited by fpmurphy; 03-19-2012 at 11:34 PM..
Reason: code tags please!
What output do you get?
By the way, shell does not support multithreading just multitasking (by forking processes). If you are using ksh88, it is not fully POSIX compliant, ksh93 would be. But I think this should work in ksh88 too. Your temporary file is in an awkward directory (the root directory) can you write there? In shell you use # for comments, not // .
{1..5} is not POSIX. You would need something like this:
or
Otherwise the shell would execute the loop only once.
Last edited by Scrutinizer; 03-19-2012 at 09:14 AM..
If one enters a Google search query like
site:unix.com mysql php
and clicks on the resulting link, one gets the message below:
vBulletin Message
No Thread specified. If you followed a valid link, please notify the administrator (2 Replies)
Assume that 100 file's of type .txt are saved in directory
in which,
40 .txt files having ID 225 in column x
10 .txt files having ID 220 in column x
30 .txt files having ID 115 in column x
and remaining 20 .txt file's having UNIQUE ID say 226,227,228,229,230....first I want to read only files... (8 Replies)
Hi This is continuation of previos thread
status=running
username=abc
password=123456
server=linux
The script was made which is used to capture the data from file
./scr test status
It will give result running
I have a case like
status = running
username=abc
password=123456... (14 Replies)
Hi,
I have a simulation program which creates two threads and I would like to know if I can measure the time of each individual thread. Threads communicate (I use pthread to manage them) and I want to measure communication time. I found a solution with clock_gettime and CLOCK_THREAD_CPUTIME_ID... (32 Replies)
How to post a new thread (Regarding Unix related doubts) in Unix Forums.
I registered my id but I am unable to post my Questions to Forum.
Thanks & Regards,
indusri (1 Reply)
Windows blows. I'm poor so unix is looking like a great alterative (expecially after my former roommate showed me most of the things it can do). Right now I'm looking at Debian or some other Unix kernel that would run nicley on my computer.
But the problem we had with installing it while he was... (3 Replies)