Sitemap

Amicuk Programming Answers

Plzzz write prog to this simple java threads question

2015-10-11   Views:2

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
Hi All, We have 2 different items which are defined as Serialized at Sale order issue at item definition. In one sale order,User has forgot to add serial number to one of the item at Ship confirm stage. He has entered serial number correctly to other [More]
We are running Enhancment Package 1 on 7.1 and the release note says that client side event is supported.  However I build 2 iViews one with Data Entry text iput and and a signal out and the the sencond one with a signal in and a text field.  I canno [More]
Good Morning All. I have a first generation MacBook Pro 1.87ghz dual core. I have recently had my ram upgraded to 2gb and installed Leopard. I have done all the updates and the ram was installed by an authorized service provider. My MBP is just autom [More]
I am running into an issue on any machine I install CS4 on in which I would like (for the time being) to keep CS2 or CS3 on whereby the Open with in get info always defaults to the particular CS4 app, no matter if I set it to CS2/CS3 and hit change a [More]
I looked through the large EAS thread with the error "Unable to validate incoming server settings."  Tried all of these issues and none have worked for me.  Exchange version is Exchange 2010 running on Server 2008 R2;  Tried without domain and i [More]
I have been using the alt key to help "nudge" items into place.  In the current document I am working on, everytime I try to use the alt key, I get kicked out of livecycle.  I don't get an error message, just a popup box that says "Adobe Li [More]
I just recently got a macbook pro. I have the latest (this is all new to me) I have a 15 inch with the thunderbird etc. Is there a way to import my email contacts from MSN/hotmail account to the mac's address book?http://email.about.com/od/windowsliv [More]
http://www.amazon.co.uk/1-8m-DisplayPort-Adapter-Unibody-Supports/dp/B003WVC8R2/ ref=sr_1_2?s=electronics&ie=UTF8&qid=1318270327&sr=1-2If you want to use the Composite input on your TV there's no Mini DisplayPort to Composite. The only adapter [More]
Hi folks, I am running oracle 10.2.0 on Linux. I would like to get rid of this sql code warning (Warning(151,3): PLW-07202: bind type would result in conversion away from column type)I get when I compile the code below. Basically Oracle does not like [More]
how can I do to install the apple store that I deleted from Maveriks? thanks you <Email Edited by Host>Continuing what I linked last time, this is an older thread that covered a similar problem.   Preview, Fontbook, Maps not working...: Apple Suppor [More]