With Apple’s new operating system for the iPhone, app makers will soon know where you are from moment to moment. But will you know where that data is?

Apple Thursday lifted one of the limitations that has long rankled startups in the location space, allowing for multitasking, or running more than one application at once. For companies like Yelp and Facebook, that means their apps will be able to track your location constantly if you allow them. While Google Android users have long had this functionality, Steve Jobs’ announcement today means in-the-background location may become more mainstream.

It’s a change that promises new features that iPhone users have yet to experience — like automatic notifications when friends are less than a half-mile away.

But it will also renew myriad privacy concerns about behavioral ad targeting. Plus, app developers may face new legal quandaries if they’re subpoenaed by government officials and asked to hand over your location history. A deep-pocketed company like Google or AT&T might demand due process before turning over data, but what about the two-man band behind your favorite iPhone app?

Recognizing the privacy concerns that persistent location-tracking raises, Apple showed off a few controls today during its announcement. When you open an app, the top bar will show a little arrow in the right-hand corner, indicating location awareness (pictured to the right). There will also be a dashboard where you can toggle location-tracking permissions on and off for different apps (pictured at the top).

It’s a thoughtful move, but undoubtedly, many more iPhone users will have their location being picked up by many more companies than they did before.

This raises a lot of privacy implications on several fronts. Location-sensitive ads represent a huge opportunity for marketers that is much more accountable than other traditional forms of brand advertising. McDonald’s could theoretically serve 10,000 people mobile ads in a city and receive analytics showing what percentage of them later actually went and visited a McDonald’s — whether that might be 24 hours or three months later. That’s much more measurable than buying a 30-second spot on TV, which can’t return granular data on how it affected purchasing behavior.

Brands and local businesses are clamoring for analytics like this, and location startups like Foursquare and Loopt have experimented a bit in this space. Foursquare launched an analytics dashboard for local businesses last month, which shows a place’s top visitors and most recent check-ins.

Today, Apple officially broke into the advertising space by unveiling a platform called iAd. The company said it expects to serve 1 billion ad impressions a day by summertime.

Now, there is a pretty important distinction between an advertising network targeting you based on where you are right now and an ad network targeting you based on years and years of your location history. As an advertiser, I could push you a coupon to a Starbucks if you’re standing near one now. Or I could push you coupons at certain times of the day, knowing your habitual route to work or your occasional penchant for dropping into a Starbucks at 3 p.m. on Wednesdays. Slightly creepy.

Jobs didn’t reveal too many details about how these ads will be targeting users. Location will almost certainly be a variable but it’s not clear whether that means location history or location now. Quattro Wireless, the company that Apple acquired in January and built iAd with, targets based on media type (whether you’re using an app, video or SMS), demographics (age, gender, ethnicity from your registration information), mobile device and present location and time. That will evolve.

Plus other companies like Facebook will want to encourage users to keep their apps on the background. How will third-party apps factor in persistent location data into their ads?

The other thorny issue around persistent location-tracking has to do with government intervention. Legally speaking, there isn’t a coherent standard that covers when mobile carriers and online services should hand over your location history to legal authorities. There are several rulings that lean toward requiring legal authorities to have search warrants in order to get tracking data from wireless carriers, but it isn’t codified. That’s the reason why about a dozen companies including Google and Microsoft banded together earlier this month to lobby the government to have this requirement explicitly written into the law. Big public companies like Google have developed a system over time for responding to government inquiries, but small-time developers probably haven’t.

That said, in-the-background location offers lots of new possibilities.

Up until now, location apps have resorted to check-ins, a lightweight way of temporarily and explicitly sharing your location. It’s one of the reasons that Foursquare was able to bound ahead of other location apps like Google’s Latitude in mindshare. At first, it was a way of getting around a technical limitation, but check-ins were also successful because of social norms — you might be really uncomfortable with having location tracking always on, for example.

Now that Apple has done away with that limitation, location apps may be able to evolve dramatically in look and feel. Apps like Plancast could send push notifications about nearby events that friends are attending while Yelp or Groupon could send you deals from businesses blocks away.

Sam Altman, chief executive of Loopt, said he’s already planning to port over features that let you know when friends are close by. (This functionality is already available in versions of Loopt on other platforms like Android.)

“We can build a nice hybrid model — one that combines the best of automated location updates with check-ins,” he said. “This will enhance serendipity when you’re near other people or places. That’s really big.”

[Photos are from GDGT, which had a great rundown of the iPhone OS announcement today here.]