Canada is legalizing adult use of marijuana on Oct. 17 and will be the second and largest country to do so. The federal government established the broad outline of the legalization law but left it up to provinces and territories to fill in some of the details -- such as whether to allow home grows, to establish a legal purchase age of 18 or 19, and whether to sell through government-run pot shops or private outlets.

Here's a look at how the industry will look, as well as some key differences between Canada's approach and that of the nine U.S. states that have legalized so-called recreational marijuana:

WHAT'S ALLOWED

Canada's Cannabis Act allows people 18 and older to buy marijuana online or in retail stores. Most provinces have raised the minimum age to 19, however, to align with the drinking age. In the U.S., states with recreational legalization have an age limit of 21, which matches the drinking age.

Canadian law sets a 30-gram limit on how much people can buy at once or possess in public. That's just over an ounce, which is the possession limit in all but one of the U.S. states with legal pot -- Maine's limit is 2.5 ounces (71 grams). However, there's no limit on how much Canadians can possess in their homes.

The Canadian law also allows for residents to grow up to four plants at home, though two provinces -- Quebec and Manitoba -- opted to forbid home-growing. U.S. states including California, Nevada, Alaska and Colorado allow home-growing of up to six plants.

------

WHAT'S AVAILABLE

Unlike in the U.S., where many types of products are available, Canada is for now allowing sales of only dried cannabis flower, tinctures, capsules and seeds. Marijuana-infused foods and concentrates are expected to be available in about a year.

Residents across Canada will be able to buy marijuana online, through websites run by each province -- a handy resource for cannabis users in any cities that might decide to ban pot shops. Most provinces will have at least some stores open next Wednesday, ranging from 20 in New Brunswick to a single store in British Columbia. Hundreds more are expected to open nationwide over the next year.

Federal taxes will total $1 per gram or 10 per cent, whichever is more. The feds will keep one-quarter of that and return the rest to the provinces, which can add their own markups. Consumers also will pay local sales taxes.

------

GOVERNMENT INVOLVEMENT

A key difference between the Canadian and American models is government involvement. The main federal effort in the U.S. is to enforce drug laws that still treat marijuana as a controlled substance.

In Canada, the federal government regulates producers. Canada so far has licensed some 120 growers.

The provinces are tasked with overseeing distribution. Some will buy wholesale marijuana and deliver it to retail stores and, through the federal postal service, to online customers. The government involvement in distribution could help control prices, keeping them at a level that is competitive with the black market without allowing overproduction to threaten the viability of licensed producers, experts say.

In some U.S. states, especially Oregon, an oversupply of legal pot has raised concerns about product being diverted to other states.

------

THE REGULATION SPECTRUM

The only other country to legalize marijuana is South America's Uruguay, which has taken an extremely deliberate and strict approach. There, pharmacies sell to adults over 18, who can buy up to 40 grams per month -- an amount tracked with fingerprint recognition. Only two types of cannabis are available.

At the other end of the regulation spectrum are U.S. states, where legalization has prompted a sort of green rush, with companies trying to get rich selling products from vape cartridges to pre-rolled joints to pot-infused sodas.

Canada is somewhere in the middle. Some licensed producers are huge companies, but there are also strict regulations on packaging to avoid appealing to youth and a ban on many types of marijuana advertising, including any that could be seen by youth or that uses depictions of celebrities.

------

IMPAIRED DRIVING AND BORDER CROSSINGS

Some U.S. states, including Washington and Colorado, test a driver's blood for marijuana impairment. In Canada, officers will for now rely on traditional observations in enforcing driving laws, but provinces say they could adopt saliva tests if one is approved by the federal government.

While authorities have placed signs on the Canadian side of the border alerting travellers that it remains illegal to bring marijuana into the U.S., some may not realize they can be barred from crossing for admitting to marijuana use. The same goes for those who tell U.S. authorities they work in the legal Canadian industry.

"We're going to see a big problem at the Canada-U.S. border," said Peter MacKay, a former Conservative Party justice, defence and foreign minister. "It's going to be thousands if not hundreds of thousands of Canadians who are suddenly going to find themselves inadmissible to the United States."