Implemented
# Linux shell scripting questions.
Implemented
# Linux shell scripting questions.
Implemented
#Client Server using AF_UNIX on my PC and ran 370 simultaneous threads
{
int i, j, k;
i = -1;
j = 1;
k = 1;
++i && j++ || ++k;
printf(“%d %d %d\n”,i,j,k);
return 0;
Completed assignment 3…But Still i do have a no. of doubts.
done assignment no. 3 except Q.8 i have following problems
Q.5char to = 1,from = 2;
to++ = from++;
error is :lvalue required as left operand of assignment
Q.4
float f=0.1f;int i;
for(i=0;i<10;i++)
f=f+0.1f;
if(f==1.0f)
this if condition should be true as on printing the value of f using %f format specifier shows 1.000000.but in program it is taken as false.WHY????
Done assignment 2,Q:7(checking a number for power of 2) using single expression.
done 8 questions from 3rd assignment ,having problem in Q5:showing errors in assignment statements like
i++=j++;
and in Q8(print cycle of sine and cosine wave),i don’t understand what to do in program;
overall enjoying C…..
int i=0;
printf(“%d\t%d\t%d\t%d\t%d\t%d\t%d\n”,i++,++i,i++,++i,i,i++,i);
What will be the output? And how?
Implemented Client Server Program using Threads,Mutex,Message Queues,Fifo. In this program each thread is created at server side for each request from requesting client. Implemented for 250 clients.
I don’t know how floats are stored.
e.g. 1.216
how will it be stored?
as 1.216e0 or 0.1216e1 or 0.0126e2 or 12.16e-1 ……?
assignment completed using mutex and semaphore both.
Implemented
#The client server program using thread, mutex,semaphore and msg queue. In the program created thread for each request from the client and at client side created 1 thread for sendg and receiving different requests.. Program ran for 381 clients and then hangs..
Issues Faced::
1)When running simultaneous clients>5 in the background the output of some client reaching some other client.Not able to successfully run more than 5 threads on my PC in parallel…. Resolved by sleep(1)..
Faced problem 1) because was using pipes for processing clients and the was using 1 mutex for each processing client and the mutex were locked and unlocked in the child and parent process respectively. This was creating a problem as the client was working on a copy of mutex… Solved by locking the mutex before fork()
2)Couldnt implement the above program using fifo as different clients take each others data so used queues and specified type for each client..found FIFO unsuccessful to implement client server using thread
i have completed assignment no 1 with some problems.