When China and the Soviets became enemies in the 60s and 70s (Sino-Soviet Split), China was really isolated. With red you can see countries closer to Russia and with green the countries closer to the United States. North Korea was following a balanced policy towards China and Russia.
Map 1 China’s Isolation
At the following map you can see the with red the communist countries aligned with Russia and with orange the ones aligned with China. North Korea and Yugoslavia were non-aligned.
Map 2 Russia and Chinese allies in the Communists World
Pakistan was China’s only good neighbor, an all weather ally, even though Pakistan was also an American ally. When the Soviets invaded Afghanistan (1979- 1989), in order to support the Afghan Communists, the Arabs of the Persian Gulf, the Americans and the Chinese, all supported Pakistan, in order to help the Afghan Islamists who were fighting the Soviets in Afghanistan.
Even Iran attacked the Soviets in Afghanistan. The Soviets were allies of Saddam Hussein of Iraq, and Iran and Iraq were fighting a war during this period (1980- 1988). The Arabs of the Persian Gulf, the Soviets, and the Americans were supporting Iraq, and China was supporting Iran. Besides, as soon as the Iranian Islamists rose to power in 1979, they started killing the Iranian Communists.
The Iranians, even though they attacked the Soviets in Afghanistan, they kept a distance from the Americans, the Arabs and the Pakistanis, by supporting Shia Islamists. Twenty per cent of the Afghan population are Shia Muslims.
During the Vietnam War (1955-1975) the Soviets and the Chinese jointly fought the Americans.
In 1979 China and United States improved their relations, and the Western companies started investing in China, and China was transformed from an agricultural economy to an industrial one.