From: shags72 on 12 Jun 2010 19:17 On Jun 12, 5:47 pm, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com> wrote: > On Jun 12, 8:56 pm, shags72 <je...(a)mtco.com> wrote: > > > > > > > On Jun 12, 12:32 pm, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com> > > wrote: > > > > On Jun 12, 7:19 pm, shags72 <je...(a)mtco.com> wrote: > > > > > On Jun 12, 11:32 am, Alexandre Ferrieux <alexandre.ferri...(a)gmail..com> > > > > wrote: > > > > > > On 12 juin, 15:29, shags72 <je...(a)mtco.com> wrote: > > > > > > > What happens is > > > > > > if using exec to open something it inconsistently hangs the program > > > > > > and you must kill your session. Although if you set the affinity of > > > > > > the program process to a single cpu then it won't hang. This is what I > > > > > > had been doing but now the program is capable of using multi cpus and > > > > > > we wouldn't be able to take advantage of the time savings. Which > > > > > > people have tested and reported huge time savings, so I have to fix > > > > > > this. Hope I explained this well enough and that this makes sense to > > > > > > you. Thanks. > > > > > > When you say "set the cpu affinity of the process", are you talking > > > > > about the (embedded Tcl) parent, or about the (other program) child ? > > > > > If you haven't already, please try both configurations and report > > > > > which one hangs. > > > > > > -Alex > > > > > I set it on the other program. I don't know how to set it on anything > > > > different. If you could let me know how I would appreciate it a lot.. > > > > Thanks. > > > > Ha ! Then, you're observing a deadlock in [exec] on Windows multi- > > > core, which is solved by single-proc'ing the child ? Very interesting.. > > > It might be a decisive clue to bug 1939509: > > > >https://sourceforge.net/tracker/?func=detail&aid=1939509&group_id=108... > > > > If you have an SF account, please go there and make yourself known. > > > Otherwise I'll mention this thread and try to stir things a bit :) > > > > -Alex- Hide quoted text - > > > > - Show quoted text - > > > OOOk. Not really sure what you meant by that. LOL. But if it helps > > someone great. By the way I don't know what an SF account so I > > probably don't have one, and the embedded version would be 8.1 if that > > would help. > > OK never mind. If we squash that one thanks to your report, you'll be > on the photo ;-) > > > about a year. Do you agree with what Bruce said? following is a quote > > from his post. > > > " but I would be surprised if the system can't use exec but can use > > open with a pipeline. (maybe the "open is fine" is based on just > > opening > > files). " > > > I hope not because I would really like to use this instead of exec if > > it will fix my issue. Somone was opening TK windows using it and he > > said that it fixed this so I thought it might fix my issue with > > opening notepad. You guys are great. Thanks. > > I tend to agree with Bruce. The only difference that comes to mind > between [open |...] and [exec] is the availability of I/O pipes to the > child, and I don't see a direct link with a deadlock in your case. > Just to be sure, when you spawn the child process with [exec], you've > got an "&", right ? > > Second question: have you actually tried [open |...] ? Does it solve > the issue without using the processor affinity trick ? > > -Alex- Hide quoted text - > > - Show quoted text - Where does the "&" go anyway? My code is pretty much as it is in the first posting. exec notepad.exe $mom_external_filename I have an if around it but that is about it. I have not tried the open command as of yet as I am at home and the software is at work. I was just trying to get the syntax right so Monday I can try it out and see. The problem is, is that is is excrutiatingly inconsistent. Sometimes it locks and then it won't. I even ran it in a loop like 50 times and it never hung once and then all of a sudden it hung.
From: Alexandre Ferrieux on 12 Jun 2010 19:26 On Jun 13, 1:17 am, shags72 <je...(a)mtco.com> wrote: > On Jun 12, 5:47 pm, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com> > wrote: > > > > > > > On Jun 12, 8:56 pm, shags72 <je...(a)mtco.com> wrote: > > > > On Jun 12, 12:32 pm, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com> > > > wrote: > > > > > On Jun 12, 7:19 pm, shags72 <je...(a)mtco.com> wrote: > > > > > > On Jun 12, 11:32 am, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com> > > > > > wrote: > > > > > > > On 12 juin, 15:29, shags72 <je...(a)mtco.com> wrote: > > > > > > > > What happens is > > > > > > > if using exec to open something it inconsistently hangs the program > > > > > > > and you must kill your session. Although if you set the affinity of > > > > > > > the program process to a single cpu then it won't hang. This is what I > > > > > > > had been doing but now the program is capable of using multi cpus and > > > > > > > we wouldn't be able to take advantage of the time savings. Which > > > > > > > people have tested and reported huge time savings, so I have to fix > > > > > > > this. Hope I explained this well enough and that this makes sense to > > > > > > > you. Thanks. > > > > > > > When you say "set the cpu affinity of the process", are you talking > > > > > > about the (embedded Tcl) parent, or about the (other program) child ? > > > > > > If you haven't already, please try both configurations and report > > > > > > which one hangs. > > > > > > > -Alex > > > > > > I set it on the other program. I don't know how to set it on anything > > > > > different. If you could let me know how I would appreciate it a lot. > > > > > Thanks. > > > > > Ha ! Then, you're observing a deadlock in [exec] on Windows multi- > > > > core, which is solved by single-proc'ing the child ? Very interesting. > > > > It might be a decisive clue to bug 1939509: > > > > >https://sourceforge.net/tracker/?func=detail&aid=1939509&group_id=108... > > > > > If you have an SF account, please go there and make yourself known. > > > > Otherwise I'll mention this thread and try to stir things a bit :) > > > > > -Alex- Hide quoted text - > > > > > - Show quoted text - > > > > OOOk. Not really sure what you meant by that. LOL. But if it helps > > > someone great. By the way I don't know what an SF account so I > > > probably don't have one, and the embedded version would be 8.1 if that > > > would help. > > > OK never mind. If we squash that one thanks to your report, you'll be > > on the photo ;-) > > > > about a year. Do you agree with what Bruce said? following is a quote > > > from his post. > > > > " but I would be surprised if the system can't use exec but can use > > > open with a pipeline. (maybe the "open is fine" is based on just > > > opening > > > files). " > > > > I hope not because I would really like to use this instead of exec if > > > it will fix my issue. Somone was opening TK windows using it and he > > > said that it fixed this so I thought it might fix my issue with > > > opening notepad. You guys are great. Thanks. > > > I tend to agree with Bruce. The only difference that comes to mind > > between [open |...] and [exec] is the availability of I/O pipes to the > > child, and I don't see a direct link with a deadlock in your case. > > Just to be sure, when you spawn the child process with [exec], you've > > got an "&", right ? > > > Second question: have you actually tried [open |...] ? Does it solve > > the issue without using the processor affinity trick ? > > > -Alex- Hide quoted text - > > > - Show quoted text - > > Where does the "&" go anyway? My code is pretty much as it is in the > first posting. > > exec notepad.exe $mom_external_filename The & is the last arg to [exec] when you just want to "fire and forget". Read the fine manual ;-) exec child args & Notepad may or may not be a good example, because it has a GUI, and in Windows such things have special status. Does your 'other program' also have a GUI ? Also, do you also want to "fire and forget", or do you want your Tcl launcher to be blocked until the child returns ? -Alex
From: shags72 on 12 Jun 2010 23:42 On Jun 12, 6:26 pm, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com> wrote: > On Jun 13, 1:17 am, shags72 <je...(a)mtco.com> wrote: > > > > > > > On Jun 12, 5:47 pm, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com> > > wrote: > > > > On Jun 12, 8:56 pm, shags72 <je...(a)mtco.com> wrote: > > > > > On Jun 12, 12:32 pm, Alexandre Ferrieux <alexandre.ferri...(a)gmail..com> > > > > wrote: > > > > > > On Jun 12, 7:19 pm, shags72 <je...(a)mtco.com> wrote: > > > > > > > On Jun 12, 11:32 am, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com> > > > > > > wrote: > > > > > > > > On 12 juin, 15:29, shags72 <je...(a)mtco.com> wrote: > > > > > > > > > What happens is > > > > > > > > if using exec to open something it inconsistently hangs the program > > > > > > > > and you must kill your session. Although if you set the affinity of > > > > > > > > the program process to a single cpu then it won't hang. This is what I > > > > > > > > had been doing but now the program is capable of using multi cpus and > > > > > > > > we wouldn't be able to take advantage of the time savings. Which > > > > > > > > people have tested and reported huge time savings, so I have to fix > > > > > > > > this. Hope I explained this well enough and that this makes sense to > > > > > > > > you. Thanks. > > > > > > > > When you say "set the cpu affinity of the process", are you talking > > > > > > > about the (embedded Tcl) parent, or about the (other program) child ? > > > > > > > If you haven't already, please try both configurations and report > > > > > > > which one hangs. > > > > > > > > -Alex > > > > > > > I set it on the other program. I don't know how to set it on anything > > > > > > different. If you could let me know how I would appreciate it a lot. > > > > > > Thanks. > > > > > > Ha ! Then, you're observing a deadlock in [exec] on Windows multi- > > > > > core, which is solved by single-proc'ing the child ? Very interesting. > > > > > It might be a decisive clue to bug 1939509: > > > > > >https://sourceforge.net/tracker/?func=detail&aid=1939509&group_id=108... > > > > > > If you have an SF account, please go there and make yourself known. > > > > > Otherwise I'll mention this thread and try to stir things a bit :) > > > > > > -Alex- Hide quoted text - > > > > > > - Show quoted text - > > > > > OOOk. Not really sure what you meant by that. LOL. But if it helps > > > > someone great. By the way I don't know what an SF account so I > > > > probably don't have one, and the embedded version would be 8.1 if that > > > > would help. > > > > OK never mind. If we squash that one thanks to your report, you'll be > > > on the photo ;-) > > > > > about a year. Do you agree with what Bruce said? following is a quote > > > > from his post. > > > > > " but I would be surprised if the system can't use exec but can use > > > > open with a pipeline. (maybe the "open is fine" is based on just > > > > opening > > > > files). " > > > > > I hope not because I would really like to use this instead of exec if > > > > it will fix my issue. Somone was opening TK windows using it and he > > > > said that it fixed this so I thought it might fix my issue with > > > > opening notepad. You guys are great. Thanks. > > > > I tend to agree with Bruce. The only difference that comes to mind > > > between [open |...] and [exec] is the availability of I/O pipes to the > > > child, and I don't see a direct link with a deadlock in your case. > > > Just to be sure, when you spawn the child process with [exec], you've > > > got an "&", right ? > > > > Second question: have you actually tried [open |...] ? Does it solve > > > the issue without using the processor affinity trick ? > > > > -Alex- Hide quoted text - > > > > - Show quoted text - > > > Where does the "&" go anyway? My code is pretty much as it is in the > > first posting. > > > exec notepad.exe $mom_external_filename > > The & is the last arg to [exec] when you just want to "fire and > forget". Read the fine manual ;-) > > exec child args & > > Notepad may or may not be a good example, because it has a GUI, and in > Windows such things have special status. Does your 'other program' > also have a GUI ? Also, do you also want to "fire and forget", or do > you want your Tcl launcher to be blocked until the child returns ? > > -Alex- Hide quoted text - > > - Show quoted text - Ok I don't use the & . Basically I use notepad to create a file and then I open it to write out to another file. I will insert the whole code following this message. So I think fire and forget is out of the picture as I need this file complete to write whatever is inside to a new file. So I think the latter is what I need, the wait until my child returns. Thanks for all the help btw. uplevel #0 { # MOM_output_literal "I am in procUL" proc MOM_load_ext_program { } { ############################# these set control in globally as cco and cci global mom_sys_control_out ;# use as needed global mom_sys_control_in global cco global cci set cco $mom_sys_control_out set cci $mom_sys_control_in ############################# global mom_external_filename mom_edit_file mom_add_seqnum mom_add_msg_leader set mom_external_filename "[MOM_ask_env_var UGII_CAM_CUSTOM_DIR]\ \text_docs\\$mom_external_filename.txt" set edit_flag 0 #MOM_output_literal $mom_external_filename if {$mom_edit_file =="TRUE"} { exec notepad.exe $mom_external_filename set edit_flag 1 after 3000 # MOM_output_literal "I am in edit" } if {$mom_add_seqnum == "FALSE"} { MOM_set_seq_off # MOM_output_literal "I am in seqnum" } elseif {$mom_add_seqnum == "TRUE"} { MOM_set_seq_on } if {$mom_add_msg_leader == "TRUE"} { ;# turns msg leader off and on BDB 10-5-09 set mlo "$cco" set mli "$cci" } else { set mlo "" set mli "" } if {[file exists $mom_external_filename]} { if {![info exists ::count_paths_used]} { set ::count_paths_used 0 if {$::count_paths_used != 0} { set file [open $mom_external_filename r] while { ! [eof $file ] } { gets $file len set len "$mlo$len$mli" MOM_output_literal "$len" } close $file MOM_set_seq_on } else { # MOM_output_literal "I am in else cpused" global delayed_ext_file global delayed_ext_file_index global delayed_mom_add_seqnum set delayed_mom_add_seqnum $mom_add_seqnum if {![info exists delayed_ext_file_index]} {set delayed_ext_file_index 0} set file [open $mom_external_filename r] while { ! [eof $file ] } { gets $file len incr delayed_ext_file_index set len "$mlo$len$mli" set delayed_ext_file($delayed_ext_file_index) "$len" # MOM_output_literal "$len" } close $file } incr ::count_paths_used } else { if {$::count_paths_used != 0} { set file [open $mom_external_filename r] while { ! [eof $file ] } { gets $file len set len "$mlo$len$mli" MOM_output_literal "$len" } close $file MOM_set_seq_on } else { # MOM_output_literal "I am in else cpused" global delayed_ext_file global delayed_ext_file_index global delayed_mom_add_seqnum set delayed_mom_add_seqnum $mom_add_seqnum if {![info exists delayed_ext_file_index]} {set delayed_ext_file_index 0} set file [open $mom_external_filename r] while { ! [eof $file ] } { gets $file len incr delayed_ext_file_index set len "$mlo$len$mli" set delayed_ext_file($delayed_ext_file_index) "$len" # MOM_output_literal "$len" } close $file } } MOM_set_seq_on } else { ;# file exists if {$edit_flag == 1} { MOM_output_literal "$cco *** New file not created. Did not save on exit of Notepad. ****$cci" } else { MOM_output_literal "$cco *** New file not created. Must have EDIT box checked in UDE to create new file. ****$cci" } };# file exists } ;# close proc } ;# close uplevel
From: shags72 on 12 Jun 2010 23:44 On Jun 12, 10:42 pm, shags72 <je...(a)mtco.com> wrote: > On Jun 12, 6:26 pm, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com> > wrote: > > > > > > > On Jun 13, 1:17 am, shags72 <je...(a)mtco.com> wrote: > > > > On Jun 12, 5:47 pm, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com> > > > wrote: > > > > > On Jun 12, 8:56 pm, shags72 <je...(a)mtco.com> wrote: > > > > > > On Jun 12, 12:32 pm, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com> > > > > > wrote: > > > > > > > On Jun 12, 7:19 pm, shags72 <je...(a)mtco.com> wrote: > > > > > > > > On Jun 12, 11:32 am, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com> > > > > > > > wrote: > > > > > > > > > On 12 juin, 15:29, shags72 <je...(a)mtco.com> wrote: > > > > > > > > > > What happens is > > > > > > > > > if using exec to open something it inconsistently hangs the program > > > > > > > > > and you must kill your session. Although if you set the affinity of > > > > > > > > > the program process to a single cpu then it won't hang. This is what I > > > > > > > > > had been doing but now the program is capable of using multi cpus and > > > > > > > > > we wouldn't be able to take advantage of the time savings.. Which > > > > > > > > > people have tested and reported huge time savings, so I have to fix > > > > > > > > > this. Hope I explained this well enough and that this makes sense to > > > > > > > > > you. Thanks. > > > > > > > > > When you say "set the cpu affinity of the process", are you talking > > > > > > > > about the (embedded Tcl) parent, or about the (other program) child ? > > > > > > > > If you haven't already, please try both configurations and report > > > > > > > > which one hangs. > > > > > > > > > -Alex > > > > > > > > I set it on the other program. I don't know how to set it on anything > > > > > > > different. If you could let me know how I would appreciate it a lot. > > > > > > > Thanks. > > > > > > > Ha ! Then, you're observing a deadlock in [exec] on Windows multi- > > > > > > core, which is solved by single-proc'ing the child ? Very interesting. > > > > > > It might be a decisive clue to bug 1939509: > > > > > > >https://sourceforge.net/tracker/?func=detail&aid=1939509&group_id=108... > > > > > > > If you have an SF account, please go there and make yourself known. > > > > > > Otherwise I'll mention this thread and try to stir things a bit :) > > > > > > > -Alex- Hide quoted text - > > > > > > > - Show quoted text - > > > > > > OOOk. Not really sure what you meant by that. LOL. But if it helps > > > > > someone great. By the way I don't know what an SF account so I > > > > > probably don't have one, and the embedded version would be 8.1 if that > > > > > would help. > > > > > OK never mind. If we squash that one thanks to your report, you'll be > > > > on the photo ;-) > > > > > > about a year. Do you agree with what Bruce said? following is a quote > > > > > from his post. > > > > > > " but I would be surprised if the system can't use exec but can use > > > > > open with a pipeline. (maybe the "open is fine" is based on just > > > > > opening > > > > > files). " > > > > > > I hope not because I would really like to use this instead of exec if > > > > > it will fix my issue. Somone was opening TK windows using it and he > > > > > said that it fixed this so I thought it might fix my issue with > > > > > opening notepad. You guys are great. Thanks. > > > > > I tend to agree with Bruce. The only difference that comes to mind > > > > between [open |...] and [exec] is the availability of I/O pipes to the > > > > child, and I don't see a direct link with a deadlock in your case. > > > > Just to be sure, when you spawn the child process with [exec], you've > > > > got an "&", right ? > > > > > Second question: have you actually tried [open |...] ? Does it solve > > > > the issue without using the processor affinity trick ? > > > > > -Alex- Hide quoted text - > > > > > - Show quoted text - > > > > Where does the "&" go anyway? My code is pretty much as it is in the > > > first posting. > > > > exec notepad.exe $mom_external_filename > > > The & is the last arg to [exec] when you just want to "fire and > > forget". Read the fine manual ;-) > > > exec child args & > > > Notepad may or may not be a good example, because it has a GUI, and in > > Windows such things have special status. Does your 'other program' > > also have a GUI ? Also, do you also want to "fire and forget", or do > > you want your Tcl launcher to be blocked until the child returns ? > > > -Alex- Hide quoted text - > > > - Show quoted text - > > Ok I don't use the & . Basically I use notepad to create a file and > then I open it to write out to another file. I will insert the whole > code following this message. So I think fire and forget is out of the > picture as I need this file complete to write whatever is inside to a > new file. So I think the latter is what I need, the wait until my > child returns. Thanks for all the help btw. > > uplevel #0 { > # MOM_output_literal "I am in procUL" > > proc MOM_load_ext_program { } { > > ############################# these set control in globally as > cco and cci > global mom_sys_control_out ;# use as needed > global mom_sys_control_in > global cco > global cci > set cco $mom_sys_control_out > set cci $mom_sys_control_in > ############################# > > global mom_external_filename mom_edit_file mom_add_seqnum > mom_add_msg_leader > > set mom_external_filename "[MOM_ask_env_var UGII_CAM_CUSTOM_DIR]\ > \text_docs\\$mom_external_filename.txt" > set edit_flag 0 > #MOM_output_literal $mom_external_filename > > if {$mom_edit_file =="TRUE"} { > exec notepad.exe $mom_external_filename > set edit_flag 1 > after 3000 > # MOM_output_literal "I am in edit" > > } > > if {$mom_add_seqnum == "FALSE"} { > MOM_set_seq_off > # MOM_output_literal "I am in seqnum"} elseif {$mom_add_seqnum == "TRUE"} { > MOM_set_seq_on > } > > if {$mom_add_msg_leader == "TRUE"} { ;# turns msg leader off and on > BDB 10-5-09 > set mlo "$cco" > set mli "$cci"} else { > > set mlo "" > set mli ""} > > if {[file exists $mom_external_filename]} { > if {![info exists ::count_paths_used]} { > set ::count_paths_used 0 > if {$::count_paths_used != 0} { > set file [open $mom_external_filename r] > while { ! [eof $file ] } { > gets $file len > set len "$mlo$len$mli" > MOM_output_literal "$len" > } > close $file > MOM_set_seq_on > } else { > # MOM_output_literal "I am in else cpused" > global delayed_ext_file > global delayed_ext_file_index > global delayed_mom_add_seqnum > set delayed_mom_add_seqnum $mom_add_seqnum > if {![info exists delayed_ext_file_index]} {set > delayed_ext_file_index 0} > set file [open $mom_external_filename r] > while { ! [eof $file ] } { > gets $file len > incr delayed_ext_file_index > set len "$mlo$len$mli" > set delayed_ext_file($delayed_ext_file_index) > "$len" > # MOM_output_literal "$len" > } > close $file > } > incr ::count_paths_used > } else { > if {$::count_paths_used != 0} { > set file [open $mom_external_filename r] > while { ! [eof $file ] } { > gets $file len > set len "$mlo$len$mli" > MOM_output_literal "$len" > } > close $file > MOM_set_seq_on > } else { > # MOM_output_literal "I am in else cpused" > global delayed_ext_file > global delayed_ext_file_index > global delayed_mom_add_seqnum > set delayed_mom_add_seqnum $mom_add_seqnum > if {![info exists delayed_ext_file_index]} {set > delayed_ext_file_index 0} > set file [open $mom_external_filename r] > while { ! [eof $file ] } { > gets $file len > incr delayed_ext_file_index > set len "$mlo$len$mli" > set delayed_ext_file($delayed_ext_file_index) "$len" > # MOM_output_literal "$len" > } > close $file > } > } > MOM_set_seq_on} else { ;# file exists > > if {$edit_flag == 1} { > MOM_output_literal "$cco *** New file not created. Did not save > on exit of Notepad. ****$cci" > } else { > MOM_output_literal "$cco *** New file not created. Must have > EDIT box checked in UDE to create new file. ****$cci" > } > > > > };# file exists > } ;# close proc > } ;# close uplevel- Hide quoted text - > > - Show quoted text -- Hide quoted text - > > - Show quoted text - Oh and also my tcl is called by this other program and it does have gui. I just click an icon in it and it runs my code.
From: Larry W. Virden on 14 Jun 2010 06:59 On Jun 12, 2:56 pm, shags72 <je...(a)mtco.com> wrote: > > By the way I don't know what an SF account so I > probably don't have one, and the embedded version would be 8.1 if that > would help. An sf account is an http://sourceforge.net/ account. That's where http://tcl.sf.net/ resides, which has all the various tcl sources, as well as bug reports, feature requests, etc. Having an account there allows you to submit a bug report and to get email when progress is made on fixing it. When you submit your bug report, please be certain to report the following things: The EXACT version of Windows you are using The hardware you are using The exact name and version of the program that has tcl embedded Upload a copy of that code you are attempting to use.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 Prev: ANNOUNCE: TkDND 2.1 Next: List to multidimensional array conversion |