How many people are in the world?

My concern is that the Earth's resources are finite and that specific groups of humans will disproportionately have undue access to those resources. Historically, when resources in an area are scarce or non existent, humans migrate to other areas. Today such migrations are limited, restricted or prevented. Such is a source of conflicts mayhem, and wars. Likewise, human needed resources , e.g.: food, water, housing, health care, education, clothing, etc are rationed via a mixture of economics and politics. That system becomes less efficient or even breaks down, the more that population increases and the demand for such resources increases while supply is less. I.E.: Available/accessible resources become more costly in terms of money, work time, availability, and ease of distribution as well as political/social restrictions. At some period, possibly around 2050ce, there may be a realization that there is just not enough necessary "stuffs" for everyone's needs and survival. At that time, "Katie bar the Door" will be the order of the day. I have no idea how to avoid such a distinctly awful situation other than being on the "right" side of the door.