Questlove said:
how do they 'anchor' themselves to a rock?
do they go in between rocks or some other method?
This may be too much information, but...
Tridacnids are members of the class "Bivalvia", which are basically molluscs with two shells. There are four main subclasses of bivalves categorized by their living environments: burrowers in soft substrates, boring bivalves in hard substrates, attached bivalves, and swimming bivalves. Tridacnids fall in the third group. From the Reef Education Network at the University of Queensland, Australia: "These bivalves (attached bivalves) live on the surface by attaching themselves to a firm substrate. Three methods of attachment are available: byssus threads (where the mollusc secretes a sticky fluid which hardens and glues to the substrate), calcified byssus and calcareous cement."
Tridacnids live on firm substrate that they are attached with via byssus threads. Over time, they add additional threads, until such time as they are very firmly anchored to the rock. When threatened (or whenever they feel like it) they can pull very strongly on these threads, and when they do they tighten up against the base rock. Croceas in particular are known for this ability -- over time they pull against the substrate and rock their shell slightly up and down, so that they slowly grind away at the underlying substrate. Croceas can be found on reef rock completely submerged in the rock so that only their mantle extends beyond the rock.
Here's a picture of byssus threads on a blue mussel. Tridacnas are similar in their method of attachment:
Here's a little snippet about zebra mussels from a military engineering site:
The process of byssal thread formation begins as the foot is pressed firmly against a substrate so that the mussel can secrete a plaque. After the plaque is formed, secretions released by the byssal gland are directed down the byssal canal to the base of the foot. The fluid hardens, forming individual byssal threads. A mussel 2.5 cm in length may have up to 600 threads holding it in place (Claudi and Mackie 1994). The zebra mussel can detach from the substrate by secreting enzymes at the base of the byssal mass and reattach by laying down new threads at another location. Composition and morphology of the zebra byssus have been examined in detail by Frisina and Eckroat (1992) and Bonner and Rockhill (1994).
Byssal attachment is beneficial to the zebra mussel for two primary reasons:
(1) It does not have to expend energy to maintain its position on the substrate.
(2) When the water level falls, an attached mussel can withdraw its foot and tightly close its shell to prevent dehydration (Eckroat and Steele 1993).