Creating multiple sessions

I have a program which gets an input file (which contain a list of objects) and processes the objects one by one sequentially. However when there are many objects it is faster to split the input into smaller lists and run the program in multiple terminal sessions simultaneously. I want to know if it's possible to create a K Shell which will open multiple sessions automatically (possibly in the background) to run multiple sessions of the program simultaneously.

Any help will be appreciated.

Steve

Hi,
I think you could use XTerm command.
For exemple, I use the following syntax to open with vi the file <my_file> at line <my_line> on the server <hostname> in background (&) :
/usr/openwin/bin/xterm -bg white -fg black -bd white -bw 5 -sl 200 -title <title> -n <hostname> -geometry 132x50 -e vi +<my_line> <my_file> &

Regards
Mathieu

Here is an overly simple example in ksh:

#!/bin/ksh
while read object
do

   nohup /path/to/my/prog "$object"  &

done < /path/to/inputfile
wait

You need to decide whether you want nohup in there. Or not.

If you have lots of objects this is a terrible idea - each process is expensive in terms of resources - you should look into threading your app instead.

We have boxes with 12 cpus and often iterate 12 "threads" of the same code to work
in parallel somewhat like this. It cuts processing time for us by a factor of 10-12 to do the parallel thing - if you have the resources.