Sitemap

Amicuk Programming Answers

Plzzz write prog to this simple java threads question

2015-10-11   Views:0

Advertisement

Write a program in C to create four processes. The original processes creates two children before it prints out "PARENT". The children processes print "CHILD1" and "CHILD2" respectively. The first child process creates a chil

Write a program in C to create four processes. The original processes creates
two children before it prints out "PARENT". The children processes print
"CHILD1" and "CHILD2" respectively. The first child process creates a child
process that prints out "GRANDCHILD".
Note: The output must be guaranteed to print out in the following order each
time it is executed:
GRANDCHILD
CHILD2
CHILD1
PARENT
a. Write the program using C or C++ and forks to create the children processes.
b. Write a second program using Java and Threads for the children processes.
The output statements for CHILD1, CHILD2 and GRANDCHILD must come from print
statements in the run method of the thread.

The replay answer
Advertisement
Most people here will not do your homework for you. If you post a reasonable question that shows you've made some effort, and what the results of that effort were, and provides details about what parts you're having trouble with, then somebody will probably provide guidance so that [you can complete the work.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Go to See the other 15 answers

Plzzz write prog to this simple java threads question

Category:DefaultRelease time:2015-10-11Views:130

Write a program in C to create four processes. The original processes creates two children before it prints out "PARENT". The children processes print "CHILD1" and "CHILD2" respectively. The first child process creates a chil[More]

Simple java architecture question

Category:DefaultRelease time:2015-10-11Views:130

This should be a simple question to answer but I haven't been able to find a good answer. I have an application that establishes a network connection with a server and registers event listeners on that connection. What I want to do is find a way with[More]

Simple Java Coding Question

Category:DefaultRelease time:2015-10-11Views:130

I know this is a simple question, but I can't search for the answer to this because it involves syntax that Google and the like don't seem to search for.. I am trying to figure out some Java code that I have found. I would like to know what: a[--i] a[More]

Simple Java EJB question.

Category:DefaultRelease time:2015-10-11Views:130

When it comes to EJB v3 Remote and Local interfaces, (With JBoss EJB Container Software in mind, for this question,) -Does the Remote interface for the EJB include method signatures from the Bean class -that are to be seen -that are to be hidden? -Do[More]

Simple Java Array Question

Category:DefaultRelease time:2015-10-11Views:130

// This is how I was taught to make a simple array. You have to define the size first. String [] test1 = new String[4]; test1[0] = "1"; test1[1] = "2"; test1[2] = "3"; test1[3] = "4"; out.println(test1[0]); out.prin[More]

Simple EVENT & THREAD question.

Category:DefaultRelease time:-0001-11-30Views:130

Hello, Let's say I create a thread from the main one... This thread is supposed to do some work while the main one is waiting for the signal that the work is done... After the signal is received by the main thread it can continue to run... How this c[More]

Java Thread question

Category:DefaultRelease time:-0001-11-30Views:130

Hello everyone, We have a C/C++ SDK lib (on Solaris) that supports JNI. Customer has a Java App (single threaded) that calls our SDK. In one of our function, we can pthread_self several times. It turns out even in this single threaded Java App, pthre[More]

Simple Java SDK question for server group assignment

Category:DefaultRelease time:2015-10-11Views:130

I have a snippet of code below in which I am trying to apply the setProcessingServerGroup() and setProcessingServerGroupChoice() methods to my report object. My question should be relatively simple: I believe I need to cast(?) my iObject report objec[More]

Simple Java regex question

Category:DefaultRelease time:2015-10-11Views:130

I have a file with set of Name:Value pairs e.g Action1:fail Action2:pass Action3:fred Using regex package I Want to get value of Name "Action1" I have tried diff things but I cannot figure out how I can do it. I can find Action1: is present or n[More]

Simple Java Sound Question...

Category:DefaultRelease time:2015-10-11Views:130

Can I draw waveforms while capturing data? If yes, how. If no, why. Thanks. I need the answer ASAP, please help.Hi nfactorial, Can I draw waveforms while capturing data?If you would like to do that in Java you would need to know about how to use the[More]

Simple java pgm - question

Category:DefaultRelease time:2015-10-11Views:130

Hallo, to the following pgm I had question: static void printPrimes (int max) (= wavy bracket; boolean(should be angular brackets) sieve = new booolean (angular br max+1 angular br) int i,j; for (i=2; i = max;i++)sieve(angluarbr i angular br)= true i[More]

Hot
Dear Experts,   Is there any Std. reprot to list all customers under particular sales org and also the material for each customer deals with.   Input only sales org. Please advise, Regards, Sivahi, Go for MCTA report ....anter the sales org as the cr [More]
My USB 3.0 - WD Passport 1 GB not recognized by Windows 8 and 8.1. There is no sound when I plug it on pc or some error message. But other USB devices works well. Maybe there is not suitable drivers for this device? Please Help me!Hi azeripatriot, We [More]
Please tell me that the only way to make a pdf is not via the god awful contact sheet II tool as its slow and much more limited ... its just taken me 20 mins to do something I usually do in 1!! not very happy at the moment as I removed bridge cs6 fro [More]
Hi All, Can't seem to send out mail whilst away from home on the road. I am still receiving email OK but trying to send anything out gets a response. "This message could not be delivered and will remain in your Outbox until it can be delivered. The c [More]
I am able to make it to the site for about 2 seconds and then I am quickly logged off and the statement, "There is a problem with your authentication, possibly due to inactivity. For your safety, you have been logged out and must sign in again to con [More]
Trying to transfer music from my itunes on my computer to my ipod touch, however it says that my Ipod is not up to date for these transfers to take place and needs version 8.2 or older. How do I go about updating my ipod for a newer update?What firmw [More]
Dear Members, Is there any good docs on installing Oracle 9i rel 2 on RH Linux enterprise edition 4. . What are the minimum software and hardware requirements.What problems i may face.What min RAM and hard disk needed ?? Need a step by step guide on [More]
import java.util.*; public class Test1{ public static void main(String a[]){ Set s = new TreeSet(); s.add(new Person(20)); s.add(new Person(10)); System.out.println(s); class Person{ Person(int i){} }basically classcast exception is thrown when the c [More]
Hi All, CAn some one share step -by step guide to roll back the deployed software updates. Regards,To put it at a high level: - Find the uninstall string/command-line for an update (not all updates can necessarily be uninstalled though) - Create an e [More]
Safari Version 7.0 (9537.71) - When I click on links on webpages like Yahoo.com, Safari is opening up a different link from that same webpage than the intended link. This is happening on both an iMac and MacBook Air running the new OS Mavericks.From [More]