Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Thread communication

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I have several threads in my application but currently i am working on the communication between two threads. These two threads are continuosly running in my application my first thread say T1 detects a client that passes a username and now T1 grants a user id to this user.The second Thread T2 now wants to access this userid from T1. How to access this userid ? is it possible for these two threads to communicate to transfer the user id?


i am accepting the username and storing in the database and return userid ;
i want this userid to be transferred to T2 because T2 will process data related to the same user ie the id generated by T1


this is the actual thing what i expect ...i had a method in T1 that passes a value to T2 and T2 collects it but the userid is always showing 0 that means it not getting passed......how can i solve this???


[Nitesh: Please UseCodeTags]
 
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
start with the tutorial
http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will say the same. You need to understand the concept of thread first

Good luck with that
 
I didn't do it. You can't prove it. Nobody saw me. The sheep are lying! This tiny ad is my witness!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic