how can i put a shared variable in two threads?

If you start the two threads from within the same class I don't see why they wouldn't be able to both access that variable if the variable is a class variable. You could also pass the variable to both threads through some constructor or method, or you could use a static variable and have both threads access that static variable.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.