As shelves empty in Pathmark and Super Fresh supermarkets that are closing, some employees are clinging to a lifeboat that may save their jobs, but cost others theirs.

And others are just out of luck.

Why are some cast adrift and others afloat?

It has to do with a union history that is as convoluted as the structure of the stores' bankrupt parent company, A&P, formally known as the Great Atlantic & Pacific Tea Co.

As A&P bought up chains over the years, unions that represented those workers came along, each with different contract provisions for bumping.

Some of those provisions fit in with court rulings in A&P's bankruptcy. Others do not.

Which is why people such as store clerk Marion Riley, 66, with more than 20 years' seniority, will be out of work Friday when the Pathmark closes on Cottman Avenue in Northeast Philadelphia.

"We're becoming extinct like dinosaurs," Riley said. "What are we going to do now? Work three jobs to survive?"

Meanwhile, her high-seniority counterparts at the Super Fresh on Columbus Boulevard, also closing Friday, may get a seat on the lifeboat - bumping to a store that is not closing.

Traditional supermarkets are under assault. "It's like a supermarket squeeze," said Mark Lang, an assistant professor of food marketing at St. Joseph's University's Haub School of Business, named for the family that once owned A&P.

Lang said supermarkets are losing their share of the food dollar, facing more competition from specialty stores such as Whole Foods and from discounters, such as Walmart and Target.

A&P, he said, like others, "didn't close stores." Now through bankruptcy and other means, it is shedding excess store capacity.

When A&P, owned by Montvale-Para Holdings Inc., filed for bankruptcy July 19, the Montvale, N.J., company said it would sell or shut its 296 stores, starting by immediately closing 25, including seven here.

Of the 271 remaining stores, buyers have stepped in to bid on 118. One bidder, Acme Markets Inc., wants to buy 76 of those stores, including nine in the Philadelphia area.

The fate of A&P's remaining stores, including 17 local Pathmark, Super Fresh, and Food Basics stores, depends on whether they attract buyers.

Bid deadline was Thursday with the auction to begin Oct. 1 in New York.

Of the seven slated to close, the Pathmark stores in Berwyn, Franklin Mills, and Folsom are already out of business, as are the Super Fresh groceries in Kennett Square and Skippack.

The Pathmark on Cottman Avenue, where Riley works, closes Friday, as does the Super Fresh on Columbus Boulevard in South Philadelphia.

How the workers fared in these stores and in others at risk depends on which union represented them.

Senior employees in stores represented by United Food and Commercial Workers Local 1776 could, as part of their contract, bump less-senior employees in A&P stores represented by Local 1776, as long as they accept the pay and benefits of the less-senior workers.

Those workers can, in turn, bump others, with some at the bottom losing their jobs.

Some of those stores are under consideration by Acme.

"We call them the lifeboat stores," said union president Wendell Young 4th. "That's your best chance of survival."

Riley and her 60 coworkers were represented by Local 1034 of the Retail, Wholesale and Department Store Union (RWDSU). Its contract with A&P does not permit senior workers who bump employees with less seniority to take a pay cut.

U.S. Bankruptcy Judge Robert Drain in New York had said he would permit worker bumping as long as it does not add costs.

"We could have taken it to the membership, but I don't think it would have passed," said Local 1034 business agent Bernard Connolly.

Local 1034 represents 10 stores locally, with one, Riley's Pathmark on Cottman Avenue, closing. The fate of the others depends on whether bidders show up. None is under consideration by Acme.

"It's tough," Connolly said. Many stores, he said, have not been invested in for years and will need work. "It's just a bad situation for everyone."

Why are there different unions for different stores?

When Pathmark began in the late 1960s, RWDSU represented its workers and continued to represent them when A&P bought Pathmark in 2007.

UFCW Local 1776 represented Acme & A&P workers in Pennsylvania. When A&P emerged from an earlier bankruptcy in the 1980s, it developed the Super Fresh chain, with UFCW Local 1776 representing workers.

In the last several years, some area Super Fresh stores became Pathmark stores, but their workers remained in Local 1776.

Young said that decades of bankruptcies prompted his union to build bumping flexibility into contracts.

Riley said she wished her union had done the same.

Meanwhile, she said, she's heartbroken that her store is closing. "We have customers who are crying and hugging us," she said. "We were a family. I loved this store."