File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Threads and Synchronization and the fly likes dont now how to use threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "dont now how to use threads" Watch "dont now how to use threads" New topic

dont now how to use threads

m bj

Joined: Dec 01, 2004
Posts: 1
hey ppl i need some help...this might be easy 4 u gurus but i dont usually use java....B(

here is my prob, i need to do somefing like this( C ) but in java:

//child process code
//father code
i visited some pages of sun explaining how to use threads but i didnt understand the usage very well...

this might look like a "u do it 4 me" situation to assign a new thred to somefing...
Thread a= new Thread(this, "Clock");
by example this method

private static int randomName(String wtf){

thanks 2 everybody dat triyes 2 help
Henry Wong

Joined: Sep 28, 2004
Posts: 20535

There is no equivalent to fork() in Java. The best you can do is start a thread to handle child code.

With fork(), the child process is actually a separate process, so resource conflicts are not a problem. Furthermore, with fork(), both the parent and child will execute the code after the if-then-else block. Again, there is no equivalent to this in Java.


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
I agree. Here's the link:
subject: dont now how to use threads
It's not a secret anymore!