Two days after a pickup truck struck and killed eight people in Lower Manhattan in what the authorities called a terrorist attack, runners preparing for the New York City Marathon on Sunday sought to beat back anxiety as the police announced additional security measures.

Competitors picking up their race materials on Thursday chatted excitedly about the course and the doughnuts, beer, pizza and other rewards they would treat themselves to after they crossed the finish line.

But many also admitted that the attack, which occurred on a bike path along the Hudson River, rattled them and left them hoping race organizers and the police were doing everything possible to keep the event safe.

“Being that I always run the West Side Highway, it is sad,” said Callie Gates, an entrant from New Jersey who will be running the race for the first time. “It was people just coming into town, taking a bike ride. That’s really sad. You just never know. That’s the scary part.”