Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Why You Should Avoid Processes
Index -> Programming, Turing -> Turing Tutorials
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Martin




PostPosted: Tue Mar 01, 2005 2:45 pm   Post subject: (No subject)

No. No processes, ever (except for music). I don't care what you are making: processes will only make your code junky.
Sponsor
Sponsor
Sponsor
sponsor
StarGateSG-1




PostPosted: Tue Mar 01, 2005 4:34 pm   Post subject: (No subject)

I am Sick and tried of all you people bashing processes becasue they are random, with that said they are. But if you are trying to save lines in a program and say you have a guiclear that you don't wnat to have to call again and again and alos not call ina procedure becasue they run by themselves and not with other parts. So yes procedures are good for like moving a character and stuff, but if you have the same command 400 times in your program make a process of it. For example if you have a press any key, which is 100's of times bigger youi don't wnat to have to right the 5 or 6 lines again and again.
Now you say well their is copy and paste.
How long do you think it takes to compile a program with 500++ extra lines??
[Gandalf]




PostPosted: Tue Mar 01, 2005 5:10 pm   Post subject: (No subject)

Quote:
Now you say well their is copy and paste.


I don't think anyone would say that Confused . Personally, I have never had to use proccess' except for music - just stick to procedures.
Bacchus




PostPosted: Tue Mar 01, 2005 6:38 pm   Post subject: (No subject)

processes are random and dont go in the order you specify. using them will make you a monkey, which is accually unfair to monkeys b/c thier really smart but they dont speak english, the speak monkey language (lol). ne who procedure are much better and even if your calling the proc many many times its still better (and what did you even mean by that, use a process?! it would run continuasly (im assuming u meant in a loop, if not it would still be like a proc) and then how would you nat have it run when you wanted to) the point of a proc is to save space you could do that very efficiently with parameters while a process is meant to just run at the same time as the main program. and who even cares if the proc doesnt run the same time as the main program? i mean cmon do you really notice the delay it takes to go completly thu a proc?
person




PostPosted: Tue Mar 01, 2005 7:10 pm   Post subject: (No subject)

Quote:
processes are random and dont go in the order you specify. using them will make you a monkey, which is accually unfair to monkeys b/c thier really smart but they dont speak english, the speak monkey language (lol).


omg!...lol u got that off of CCC

Quote:
I am Sick and tried of all you people bashing processes becasue they are random, with that said they are. But if you are trying to save lines in a program and say you have a guiclear that you don't wnat to have to call again and again and alos not call ina procedure becasue they run by themselves and not with other parts. So yes procedures are good for like moving a character and stuff, but if you have the same command 400 times in your program make a process of it. For example if you have a press any key, which is 100's of times bigger youi don't wnat to have to right the 5 or 6 lines again and again.
Now you say well their is copy and paste.
How long do you think it takes to compile a program with 500++ extra lines??


i dont understand y u cant use a procedure instead i mean who cares if it runs on its own...like the user is gonna notice
Bacchus




PostPosted: Tue Mar 01, 2005 7:32 pm   Post subject: (No subject)

yes exacly

and yes it did come from CCC lol that was a funny question and had me confused for a bit. funny thing was i screwed up question 3 sooo much. i was like over thinking it and started to use flexible arrays and more complex things and completly lost my train of thought redid it a couple times to no avail came close started to go crazy and twitchy (i do that quite often) and went to the next question lol
person




PostPosted: Tue Mar 01, 2005 8:46 pm   Post subject: (No subject)

just wondering did u get q4?
Bacchus




PostPosted: Tue Mar 01, 2005 9:17 pm   Post subject: (No subject)

we're not really suposed to be talking about this but i wont reviel much. i was spacing out and kept reading the same thing over and over so i got fed up and just made the accual picture and had a guy walk around till he stopped and i could figure out where he was lol
Sponsor
Sponsor
Sponsor
sponsor
Martin




PostPosted: Wed Mar 02, 2005 10:42 am   Post subject: (No subject)

Here's a challenge, open for anyone.

Write a program using processes that I can't improve by getting rid of the processes. If you can do this, I'll give you 1000 bits.

Go. Only rule is no music.
StarGateSG-1




PostPosted: Wed Mar 02, 2005 12:28 pm   Post subject: (No subject)

I will take your challenge and I will beat you.
But one questions who's is to say what is better Question
obvious you nor me can decide and i don't think this is a impartial person on this forum.

But we will deal witht that later.
Tony




PostPosted: Wed Mar 02, 2005 1:26 pm   Post subject: (No subject)

StarGateSG-1 wrote:
But one questions who's is to say what is better Question

We'll run both programs though tests. Execution times, glitches, etc.

Btw, Martin:
F10 Turing Reference wrote:

Music.PlayFileReturn ( fileName : string )

Unlike Music.PlayFile, the Music.PlayFileReturn procedure should not be called in a separate process. Instead, the procedure returns immediately. This makes Music.PlayFileReturn easier to use, but makes it unsuitable for playing a set of files sequentially.
Martin




PostPosted: Wed Mar 02, 2005 2:14 pm   Post subject: (No subject)

Yeah, I haven't used turing in a while suffice to say.
Mazer




PostPosted: Wed Mar 02, 2005 3:14 pm   Post subject: (No subject)

What's wrong with what Martin said? Music.PlayFileReturn just calls a process, so it makes sense not to allow music in the competition.
person




PostPosted: Wed Mar 02, 2005 3:37 pm   Post subject: (No subject)

code:

process a
    put "hi"
end a
process b
    fork a
    put "ho"
end b
loop
    fork b
end loop


puts random hi and ho (dont know if it counts though)
Tony




PostPosted: Wed Mar 02, 2005 4:45 pm   Post subject: (No subject)

Damn it, processes are so freaking hard to benchmark Confused Here're the two programs with benchmarks incorporated. I hope everybody finds them fair.

processes
Turing:

var bench : int := 0
process a
    put "hi"
    bench += 1
end a
process b
    fork a
    put "ho"
    bench += 1
end b
loop
    fork b
    exit when bench >= 100
end loop
put ""
put "Bench :: ", bench
put Time.Elapsed

Results:: 100 outputs in ~1800

no processes
Turing:

var bench : int := 0
loop
    if (Rand.Real > 0.5) then
        put "hi"
    else
        put "ho"
    end if
    bench += 1
    exit when bench >= 100
end loop
put ""
put "Bench :: ", bench
put Time.Elapsed

Result:: 100 outputs in ~855..

Results of this case study... vertually identical output, but processes take up twice as long. Also notice that in processes, even after the benchmark has been reached and loop exited, "hi/ho" output still went in between the results. Glitches are not undocumented features.

so.. ~1800 milliseconds for processes vs. ~850 without.

Anyone else?
Display posts from previous:   
   Index -> Programming, Turing -> Turing Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 7  [ 99 Posts ]
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
Jump to:   


Style:  
Search: