Reply To: Weird MEW / Batch File Interaction

Product Compare Forums Multi-Edit Support Weird MEW / Batch File Interaction Reply To: Weird MEW / Batch File Interaction

#5361
ReidSweatman
Participant

This is really a SWAG off the top of my head, but I don’t think there’s anything wrong with what you describe; it’s what I would expect. If Multi-Edit is already running, it’s running in its own process, using its own threads. Your batch program is simply passing commands to an already-running service, and hence, doesn’t expect or require that service to shut down before continuing. On the other hand, if the batch program starts Multi-Edit on its own, Multi-Edit is running in a spawned process owned by the batch program, and the batch program reasonably expects the process to terminate correctly before it continues with the next command (in such a circumstance, I doubt the batch program would be set up to handle the spawned process thread asynchronously; that would be a recipe for disaster).

Your case (4) is likely due to mis-synchronization between the two programs that prevents Multi-Edit from responding to the system for at least four seconds (assuming you’re running under Windows XP SP1 or later). That will cause Windows to decide Multi-Edit isn’t responding. A strong possibility is that the batch program is responding too rapidly to Multi-Edit’s shutdown, attempting to continue before the spawned thread is actually dead. Minor possibility of a race condition, since Multi-Edit isn’t multi-threaded.

What you should do to sort this out is grab some of the nice free tools at <a href="http://www.sysinternals.com:2m6ia6ke]SysInternals[/url:2m6ia6ke], especially those intended for debugging process and thread usage, and attach them to, first, the batch program, and second, the spawned copy of Multi-Edit. Look at what’s active and when, and how much cpu time each process involves. Even just using Process Explorer after the hang occurs will tell you a lot. DebugView can also be pretty useful, and you can run it from within Process Explorer if you’ve set it up as Windows’ system debugger (see the [url=http://msdn.microsoft.com:2m6ia6ke]Microsoft MSDN Site[/url:2m6ia6ke”> for information on how to do that). Likewise, you can use Process Explorer as a replacement for Windows’ Task Manager.

One final thought occurs to me: is the batch manager you mention an older, 16-bit program, or maybe even a DOS program? If so, that’s likely the cause. You might visit <a href="http://www.outertech.com:2m6ia6ke]OuterTech[/url:2m6ia6ke”> and snag a free copy of BatchMan and see if you have the same problem with it. I’ll also give Thomas a free plug here and recommend his LinkMan, the best URL manager I’ve run across.