Yahoo’s turnaround attempt is going to be messy.

In his first three months on the job, CEO Scott Thompson has imposed the largest layoffs in the company’s 17-year history, reshaped the board of directors, picked a potentially disruptive fight with a major shareholder and sued Facebook for patent infringement.

He says there’s even more upheaval to come.

Thompson delivered a painful jolt Wednesday with a payroll purge of about 2,000 workers, or about 14 percent of Yahoo’s 14,100 employees. The cuts will save about $375 million annually as Yahoo tries to boost its earnings and long-slumping stock price.

More shakeups loom as Thompson reshuffles divisions and considers selling an online ad-placement service and other operations that don’t fit into his strategy.

Those potential changes will follow a tumultuous time for Thompson, an affable and well-respected executive who held the top job at eBay Inc.’s thriving PayPal service before being lured away to help salvage Yahoo.

Thompson “definitely seems to be taking a very broad and bold view of what needs to be done at Yahoo,” said Standard & Poor’s Capital IQ analyst Scott Kessler. “He seems to know it isn’t going to be easy and it isn’t going to be pleasant.”

The specifics of Thompson’s vision are still unclear. In comments to analysts and reporters, he has talked generally about doing a better job of analyzing the data that Yahoo collects about its 700 million monthly visitors. That would help the company sell ads and develop mobile services to connect with the growing number of people surfing the Web on smartphones and tablet computers.

Once an Internet trendsetter, Yahoo has been outmaneuvered and outsmarted by Google and Facebook in the race for online advertising. Although Yahoo’s website remains a popular destination, people have been spending less time there and dwelling longer on Google services and on Facebook.

That shift has made Yahoo less attractive to advertisers, a problem that has been compounded by the company’s inability to target marketing messages at the right audience as precisely as Google and Facebook.

After announcing the layoffs Wednesday, Thompson promised to share more details about his plans April 17, when Yahoo Inc. is scheduled to release its quarterly earnings.

“We are intensifying our efforts on our core businesses and redeploying resources to our most urgent priorities,” Thompson said Wednesday in a statement. “Our goal is to get back to our core purpose – putting our users and advertisers first. And we are moving aggressively to achieve that goal.”

Investors haven’t been buying into Thompson’s vision so far, partly because his predecessors have made and broken similar promises. Thompson is Yahoo’s fourth full-time CEO in less than five years – a period marked by steady declines in revenue, even though more advertising has been shifting to the Internet.

Yahoo shares gained 9 cents Wednesday to close at $15.27. The stock price has dropped by 6 percent since Yahoo announced Thompson’s hiring in early January. The downturn leaves Yahoo more vulnerable to takeover offers from potential suitors who might prize Yahoo’s brand and its popular news, finance and entertainment services. Yahoo shares have not traded above $20 in more than 3 1/2 years.

As traumatic as the job cuts may be for laid-off workers, Kessler says Yahoo needed to prune its payroll to show Wall Street that the company can be run more efficiently than it has been in recent years.

Last year, Yahoo produced revenue of $353,000 per employee while its two biggest rivals, Internet search leader Google Inc. and social networking leader Facebook Inc., each generated $1.2 million per employee.

Other major technology companies were also far more productive: Microsoft Corp. had about $800,000 in revenue per employee last year, while Intel Corp. posted $540,000 in revenue per employee, according to S&P’s data.

Yahoo’s housecleaning marks the company’s sixth mass layoff in four years. This one will inflict the deepest cuts yet, eclipsing a cost-cutting spree that laid off 1,500 workers in late 2008 as Yahoo tried to cope with the Great Recession.

After some of its previous reductions, Yahoo eventually hired more workers to fill newly created positions. Thompson indicated Yahoo won’t be restoring many jobs, saying he is striving to create a smaller and more nimble company to compete against Google and Facebook. It’s a battle that Yahoo has been losing as its annual revenue has fallen from a peak of $7.2 billion in 2008 to $5 billion last year.

The financial decay, coupled with Thompson’s changes, could make it increasingly difficult to retain the best workers.

“You have to wonder why any employee that is any good would stay at this point,” said BGC Financial analyst Colin Gillis. “Will Thompson have the horses he needs to reach his goals?”

Even before Thompson arrived, some of Yahoo’s most talented employees were defecting to other jobs.

Meanwhile, Google and Facebook are hiring even more engineers and sales representative to develop new products and sell more ads. Google added 8,000 employees last year, and Facebook recently moved to sprawling headquarters in Menlo Park, Calif., in anticipation of tripling its current workforce of about 3,200 people within the next few years.

Besides employee morale issues, Thompson also will have to deal with a disgruntled shareholder during the next few months.

Activist investor manager Daniel Loeb, who controls a 5.8 percent stake in Yahoo through a hedge fund called Third Point LLC, thinks he can help the company bounce back if he and three of his allies are allowed on the board of directors. Thompson told Loeb he wasn’t the best-qualified candidate for the board, although he says Yahoo was willing to work with Third Point to find two mutually acceptable directors.

Loeb is now attacking Thompson and the rest of Yahoo’s board in a campaign to persuade the company’s shareholders to elect him and three other alternative candidates as directors. If a truce isn’t reached, the dispute will be revolved in a shareholder vote at Yahoo’s annual meeting, which probably won’t be held until June, at the earliest.

Loeb described the layoffs as “unfortunately necessary” but criticized Thompson for imposing them without explaining how he intends to revive Yahoo’s revenue growth.

“Many of Yahoo’s senior-level employees and investors have apparently seen enough and heard too little,” Loeb said in a statement.

Thompson alienated much of Silicon Valley by suing Facebook as the social networking company is trying to raise $5 billion in an initial public offering of stock expected to be completed next month. The lawsuit accuses Facebook of infringing on 10 of Yahoo’s Internet patents.

Facebook denied the allegations and retaliated with a patent-infringement lawsuit against Yahoo.