The Communist parties of China and the Soviet Union have exchanged greetings for the first time in more than two decades, it was disclosed here today.

With this simple exchange, and other gestures by the Chinese, China has moved to lower a barrier that has divided the two Communist giants since a bitter ideological dispute in the late 1950s, according to diplomats here.

Hu Yaobang, general secretary of the Chinese Communist Party, first congratulated the new general secretary of the Soviet Communist Party, Mikhail Gorbachev. Today, according to the official New China News Agency, Gorbachev responded by conveying his best regards to Hu in a meeting with Vice Premier Li Peng, head of China's delegation to the funeral of the late president Konstantin Chernenko.

A renewal of relations between the parties dominating the governments of the Soviet Union and China could improve other aspects of the Sino-Soviet relationship.

Whatever else it might mean, a renewal of party ties would be of great symbolic importance for the two nations, experts say, and hold the potential of catapulting them beyond their growing trade, economic, cultural and scientific exchanges of the past two years.

The official Chinese news agency indicated, meanwhile, that the positive signaling also was coming from Moscow. In a dispatch today, the news agency reported that Gorbachev reaffirmed in his meeting with Li Peng the Soviet Union's desire that Sino-Soviet relations improve in a major way. He was reported to have told Li Peng that the Soviet Union and China should continue their dialogues and heighten their level, work jointly to reduce differences and make progress in a wider scope of areas.

None of this means a return to the old alliance between the two Communist giants, diplomats say. Nor does it seem to mean elimination of the three "obstacles" that the Chinese previously have said hindered the normalization of relations. These obstacles include the stationing of Soviet troops along the Chinese border and in Mongolia, the presence of Soviet troops in Afghanistan, and Soviet support for Vietnam's occupation of Cambodia.

But diplomats here argue that despite the continuing existence of those obstacles, the Soviets and the Chinese are now clearly in the process of normalizing their relations. Some think that the signaling going on between the two Communist parties is certain to lead to a renewal of formal party-to-party ties, unthinkable between these two ideological foes not so long ago.

According to analysts here, the Chinese want to place their main emphasis for years to come on economic modernization. Reducing tensions with the Soviets could serve that end. Having built hundreds of factories in China during an earlier, friendlier period, the Soviets could aid the modernization program.

The Chinese apparently perceive less of a direct Soviet threat than they once did. Improved relations with the Soviets also might further their independent foreign policy image while not automatically damaging their ties with the United States and other western nations.

As diplomats see it, here are some of the signals from the Chinese side that point to an improvement in relations:

Peking's messages of condolences and praise for Chernenko seem to be warmer than those sent last year when Chernenko's predecessor, Yuri Andropov, died.

On Tuesday, the Chinese sent a relatively high-ranking official, Peng Zhen, chairman of the National People's Congress standing committee, to the Soviet Embassy in Peking to offer his condolences. After Andropov's death, the Chinese sent a lower ranking figure, Vice President Ulanfu, to the embassy with condolences.

The Chinese press has given much more extensive and factual coverage of the Chernenko funeral and other related events than it did to the Andropov funeral.

Vice Premier Li Peng has stressed the benefits to be gained from an improvement in Sino-Soviet relations. According to the Chinese news agency, Li told the Chinese Embassy staff in Moscow today that such an improvement is in the interest not only of the two nations, but also of peace in the Far East and in the world.

On at least four occasions in recent days, the Chinese have congratulated Gorbachev on his rise to the post of party general secretary. Peng Zhen at one point referred to him as "Comrade" Gorbachev.

Also, according to the Chinese news agency, Li Peng, when he first met Gorbachev yesterday, expressed the wish for Soviet accomplishments in "socialist construction." This was also seen as significant because China for years had refused to acknowledge that the Soviet Union is a socialist country.

Despite all this, some diplomats still doubt that the current improved atmosphere between the Chinese and Soviets will ever lead to a renewal of party-to-party ties.

But the obstacles to establishing ties no longer seem quite as formidable as they once did.