SpyrosMet -3 Light Poster

hi everyone

I have a problem with a server - client project i have built. At first I made it work by forking and using shared memory. Then i had to replace those things with threads and the problem is that i don't know how to attach the client to a thread so that it can use the data the server has to search for something. my code is the following

read(sock2, &thread, sizeof(thread));//transfering the thread's id from the server
  fixedparkpnt = shmat(parkid, NULL, 0);//Here is where it was attaching to a shared memory segment before the change. I want it to attach to the thread by using its id