Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Go Back   Code Forums > Systems > Linux / BSD / OS X
User Name
Password

Reply
 
LinkBack Thread Tools Display Modes
Old 01-22-2006, 10:36 PM   #1 (permalink)
ashok rajagopal
Registered User
 
ashok rajagopal's Avatar
 
Join Date: Sep 2005
Posts: 20
ashok rajagopal is on a distinguished road
Restart logic for multithreading

I am coding a shell to bring about multithreading in an existing application. As of now, a shell script is there, and it runs a .exe passing in a data file as parameter. My logic is breaking down the data file into equal partitions and then calling the .exes with each one getting one of the split files. then all the exes run together. My question is, what would be the best restart logic for the above set up ? ie. if one of the threads fail, that will have to be restarted, and exactly when should it start and how the logic has to be implemented? a pseudocode or algorithm would be appreciated.

thanks in advance.
__________________
ashok rajagopal is offline   Reply With Quote
Old 01-23-2006, 01:34 PM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,114
Belisarius is on a distinguished road
You're running .exe's in a Unix environment?
__________________
GitS
Belisarius is offline   Reply With Quote
Old 01-23-2006, 01:55 PM   #3 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,680
redhead is on a distinguished road
I could come up with a number of solutions written in C, which would be less file i/o intensive, than having a shell script splitting up a file.
Given that file i/o most likely will be the bottleneck here, you might considder a solution where the splitting of the file/spawning of threads, might be done in a different manner, at a slightly higher memory cost.

Now if you're working on a embeded system, where memory is sparse, then that might lead to a solution like this, but for any other implementation, I would turn to other solution patterns.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
possible logic errors in my code? ajstee123 Standard C, C++ 7 09-27-2005 04:13 PM
2D graphic repaint logic ralphtan Java 1 08-13-2004 03:49 AM
Reversing String logic M3GAPL3X Standard C, C++ 8 07-15-2003 08:11 AM


All times are GMT -8. The time now is 10:23 PM.


Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle