本文介绍了线程的全局变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在网站上进行简单的线程化,线程完成后我想返回线程函数返回的值,所以我想使用全局变量来存储它。然后我将从全局变量中获取值。我尝试了会话,cookie但值已重置因此使用静态但它保存了访问网站的多个用户的值是否有任何其他可能的全局变量用于单个用户具体?提前致谢。



我尝试过:



大家好,

我正在网站上进行简单的线程处理,线程完成后我想返回线程函数返回的值,所以我想使用全局变量来存储它。然后我将从全局变量中获取值。我尝试了会话,cookie但值已重置因此使用静态但它保存了访问网站的多个用户的值是否有任何其他可能的全局变量用于单个用户具体?提前谢谢。

解决方案

hi guys,
I'm working on a simple threading in a website, after a thread is completed I want to return the values returned by thread function so I want to use global variables to store it. and later I'll get the values from the global variable.I tried session,cookies but values got reset So used static but it saves the values of multiple user accessing the website is there any other possibility of global variable to be used for single user specific?Thanks in advance.

What I have tried:

hi guys,
I'm working on a simple threading in a website, after a thread is completed I want to return the values returned by thread function so I want to use global variables to store it. and later I'll get the values from the global variable.I tried session,cookies but values got reset So used static but it saves the values of multiple user accessing the website is there any other possibility of global variable to be used for single user specific?Thanks in advance.

解决方案


这篇关于线程的全局变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 10:10