Linux Today: Linux News On Internet Time.
Search Linux Today
search.internet.com
Linux News Sections:  Blog -  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Preferences
Contribute
Link to Us
Search
Linux Jobs

Become a Marketplace Partner

internet.commerce
Be a Commerce Partner














The Linux Channel at internet.com
Linux Today
Enterprise Linux Today
Apache Today
JustLinux.com
Linux Planet
PHPBuilder
All Linux Devices
Technology Jobs

JustTechJobs.com

LinuxToday Newsletters
Server Daily
IT Management Daily
Subscribe News
Subscribe PR
Subscribe Security

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

 






Current Newswire:

"Saner Defaults" remix of Ubuntu beta released

GNU Debugger adds D language support

Gnome-do: Open Source Software App Launcher

Debunking the 1% Myth

Wine 1.3.2 has been Released

Linuxables: Compiz window switcher

Alien - Use Any Package On Any Distribution

NVIDIA Puts Out A Major Beta Linux Driver Update

The Value of Clear Code is Clear

Google Chrome 6.0.472.53




Systems Administrator - Solaris (NYC)
Next Step Systems
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume
:Demonstrating multi-processing in Bash 4
Demonstrating multi-processing in Bash 4
Jul 29, 2010, 16 :06 UTC (0 Talkback[s]) (1922 reads)

"I have an on-going project, to code the Collatz sequence in as many languages as I can. So far, I've implemented it in C (integer and floating-point), assembly (x86, x86_64, and SPARC32), Java, BASIC in Open Office.org, Tcl, Lisp, Ada, Python, and Bash. Naturally, the fastest method is assembly, which can by-pass all the cautions of the other, translated languages.

"One point I've given myself extra credit for, is to use both cores on my AMD Athlon64 X2, making sure to print out results in order. Different languages have different ways to do this. (Python has the most elegant method I've seen, using a source array and a result array, and calling Pool() to dispatch the next iteration to whichever CPU just became available, until all results are finished. However, this means deferring printing the results until the entire result set is available.)

"Bash has had multi-processing for a long time, via job control, the $! environment variable, and the wait command. Judicious use of parentheses for sub-processes, and pipes where necessary, can put comparatively long-term procedures into the background. One example of this is the time-of-day monitor I used in my holiday slideshow."

Complete Story

Related Stories:
Bash Co-Processes(Jul 27, 2010)
Writing Better Shell Scripts � Part 2(Jul 27, 2010)
Tool of the week � ftsh(Jul 26, 2010)
Z shell made easy(Jul 16, 2010)
BASHing Visual Basic Out of the Picture(Jun 28, 2010)
Get the Most Out of Bash History(Jun 22, 2010)



No talkbacks posted.
  Home | Search Talkbacks | Customize View    Top of Page  



Enter your comments below:

* Your Name:

* Your Email Address:

* Subject:

CC: [will also send this talkback to an E-Mail address]

* Comments:

Tags allowed:<I>,<B> and <U>. See our talkback-policy for more about talkback content.

Fields marked with * are required!






..............................




All times are recorded in UTC.
Linux is a trademark of Linus Torvalds.
Powered by Linux, Apache and PHP