Unix Programming - Most Complex Problem

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > July 2007 > Most Complex Problem





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Most Complex Problem
Omar Abid

2007-07-12, 1:19 pm

Hi folks,
It really don't interest me or i don't need a solution for this
problem but it always turn on my mind.
How can i with VB, C#, Java.... or any other languages create a 2 or
more simultaneous actions !
For example : Copying 2 file
1/Filecopy input output
2/Filecopy input output
Is there a solution to make those two command works simultaneously

Thanks for thinking
Omar Abid

(If you are interested on VB.net visit this group)
http://groups.google.com/group/VB2005?lnk=li

Barry Margolin

2007-07-13, 1:22 am

In article <1184256668.403786.274620@k79g2000hse.googlegroups.com>,
Omar Abid <omar.abid2006@gmail.com> wrote:

> Hi folks,
> It really don't interest me or i don't need a solution for this
> problem but it always turn on my mind.
> How can i with VB, C#, Java.... or any other languages create a 2 or
> more simultaneous actions !
> For example : Copying 2 file
> 1/Filecopy input output
> 2/Filecopy input output
> Is there a solution to make those two command works simultaneously


Use multiple processes or threads. Here's how to do it in shell:

cp input1 output1 & cp input2 output2

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Fred Kleinschmidt

2007-07-13, 1:22 pm


"Barry Margolin" <barmar@alum.mit.edu> wrote in message
news:barmar-D07D4D.21480712072007@comcast.dca.giganews.com...
> In article <1184256668.403786.274620@k79g2000hse.googlegroups.com>,
> Omar Abid <omar.abid2006@gmail.com> wrote:
>
>
> Use multiple processes or threads. Here's how to do it in shell:
>
> cp input1 output1 & cp input2 output2
>


The above doesn't really do the two simultaneously. The two processes
may appear to be working at the same time, but in reality one process
gets some time, then it is rolled out and the other process gets some time,
then that one rolls out and the first task resumes, etc.

The only way to do it truly simultaneously is if you have two separate
processors.
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Aero Stability and Controls Computing


Logan Shaw

2007-07-14, 1:26 am

Fred Kleinschmidt wrote:
> The only way to do it truly simultaneously is if you have two separate
> processors.


Or I/O that uses DMA. Then the processor only needs to start transfers,
not copy every byte.

- Logan
Pascal Bourguignon

2007-07-14, 1:26 am

"Fred Kleinschmidt" <fred.l.kleinmschmidt@boeing.com> writes:

> "Barry Margolin" <barmar@alum.mit.edu> wrote in message
> news:barmar-D07D4D.21480712072007@comcast.dca.giganews.com...
>
> The above doesn't really do the two simultaneously. The two processes
> may appear to be working at the same time, but in reality one process
> gets some time, then it is rolled out and the other process gets some time,
> then that one rolls out and the first task resumes, etc.
>
> The only way to do it truly simultaneously is if you have two separate
> processors.


Who said there was only one processor, or only one disk, or only one channel?

--
__Pascal Bourguignon__ http://www.informatimago.com/

NOTE: The most fundamental particles in this product are held
together by a "gluing" force about which little is currently known
and whose adhesive power can therefore not be permanently
guaranteed.
David Schwartz

2007-07-16, 1:20 pm

On Jul 13, 7:40 am, "Fred Kleinschmidt"
<fred.l.kleinmschm...@boeing.com> wrote:

> The above doesn't really do the two simultaneously. The two processes
> may appear to be working at the same time, but in reality one process
> gets some time, then it is rolled out and the other process gets some time,
> then that one rolls out and the first task resumes, etc.


That's a misleading statement for a variety of reasons. The primary
one is to assume that a process is only accomplishing useful work when
that process is running. For example, when a process goes to write
some bytes to a file, they are likely only copied into memory. The
system continues to do useful work on behalf of that process even
while another process has been switched to.

> The only way to do it truly simultaneously is if you have two separate
> processors.


Untrue. A modern computer system contains numerous agents that are in
fact capable of operating concurrently. For example, disk can read
data into its local cache while the CPU is doing something else. In
may cases, the disk can even transfer data out of main memory using
DMA while the CPU is doing something completely different.

DS

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com