Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Post
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
5
Reply
Global/Public Variables in Multithreading
jaypee bacol
Dec 22 2009 10:29 PM
7k
Reply
Hi Nikki,
My thread has a function with parameters -> Process_GIF_Creation(p_outputFilePath, pstrDT, intDir); These 3 parameters are declared globally/publicly. My concern is that the possibility of having a conflict/problem of using these 3 variables since I am using multiple thread. I have just read an article thru internet, please see below.
Link ->
http://www.codersource.net/csharp_tutorial_multithreading.html
"At first, if one wants to create a multi-threaded application an important point to be remembered is, a global variable, which is being accessed by different threads, can try to modify the same variable. This is a generic problem, which is solved using a mechanism called Synchronization of threads. Synchronization is nothing but the process of creating some set of rules to operate data or resources."
Base in my requirement, I need to use scychronization of threads? Please advise me which is recommended.
Thanks,
Jaypee
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
How to implement multiple thread?
How to show/load a form inside the thread function and include it in Application.form?