Discussion Locked

Foreground vs Background /Task Scheduler

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

We are using Windows 2000's Task Scheduler to run an MS Word based Application on 3 seperate Workstations. On 2 of the workstations if the task is running while the user id associated with the task is logged on, the process runs in foreground (i.e. you can see the visible components). If any other ID is logged on the process runs completely in the background and there are no visible aspects at all. The process creates a Word Document in both cases.
The 3rd machine always runs the process in background, no matter what id is logged on. The question is: how do control whether the process runs in forground or background? MS Word seems to have a few problems when run in the background so we want to force it to run in the forground.
Thanks,
Ralph

9 replies

by gregory w. smith

Since the Task Scheduler forces specification of a username/password, you may want to look at a different scheduler. WordParfect 6 for Windows had one that worked fairly well, and being security-unaware, would run the app in the context of the current user. (This could be a problem if there is NO current user - ie. not logged on)

by ralph.a.eyman

Thanks for your reply, but we're not licensed for Word Perfect. The Window's 2000 Task Scheduler works perfectly on two workstations, so I know it can do what is required. I'm just trying to figure out the "Rhyme and Reason". Ralph

by james_randy

Use the same color for background, foreground, object and text color, and everything. That'll give you a real challenge, won't it?

by maxwell edison

Greetings,

Your 3rd machine, the one that always runs the scheduled task in the background, has something different (something installed, something running, etc.) than the other two machines that run the same scheduled task in the foreground.

Read the following article on:

"Foreground/Background priority"

An excerpt from that article:

Any foreground process will have its threads boosted to 2 units above the background priority. This makes the program you are working on more responsive to the mouse and keyboard than a program that is running in the background, for example, checking email.

....But what this means, for example, is that a background program that comes out of I/O wait on an audio device is very likely to be able to exceed the priority of your foreground task that is simply doing a long computation. And moving the mouse is going to give your foreground thread, the one talking to the GUI, priority over the background thread of your foreground task that is talking to a serial port. (It doesn't know the difference between a background or foreground thread; all it knows is the thread that was waiting came out of a mouse wait, so that thread gets boosted).

End of excerpt.

See the whole article and a list of I/O priorties at the folowing site:

http://www.codeproject.com/system/simpletime.asp

(The foreground/background priority issue starts about 1/3rd down in the article, but the entire article is time related.)

I didn't answer your issue specifically, but perhaps this article will at least shed some light on it and lead you to a solution. The article was certainly interesting to me.

Regards,

Maxwell

by maxwell edison

.
.
Also, do an Internet search for "Task Control Block". A task control block is used to communicate information about tasks.

Again, not a real specific answer, but perhaps you'll see something helpful.

Good luck,

Maxwell

by ralph.a.eyman

Maxwell provided good information and some good sources for Windows 2000 in general, and the sincere attempt to recommend a solution was greatly appreciated. I still don't understand why the scheduler is behaveing as it is, but the question is mute now anyway. The disk on the workstation in question crashed and when a new disk was installed and Windows 2000 configured the Scheduler works as it should. I am closing the question. Thanks for all replys.

This discussion is closed to new replies.