[Front] [Prev Chapter] [Next Chapter]

Chapter 13 Multitasking and Task Switching

Loading and Configuring the Task Manager

Using the Task Manager Menu

Working with Tasks at the System Prompt

Rebooting While the Task Manager is Loaded

Task Manager Troubleshooting


The operating system provides you with the ability to run more than one application at the same time. The program that provides this feature is referred to as the "Task Manager."

Running multiple applications simultaneously, and being able to switch between them, means that your most frequently-used applications are always available instantly. You can also run multiple copies of the same application, such as a word processor. You can load multiple TSRs, to make the best use of memory.

You add applications as "tasks" to a menu, which you can display at any time. When you switch from one task to another, the task you switch from is "swapped out" to memory, or to a "swap file" on disk.

If your computer has a 386* processor (or later) with at least 2 MB of extended memory, you can use the Task Manager as a "multitasker," running multiple tasks simultaneously and switching between them. Alternatively, you can use the Task Manager as a "task switcher" only, in which case you can switch between applications but those you switch from are suspended in the background until you return to them. If your computer is 80286-based, with at least 3 MB of memory, you can only use the Task Manager as a task switcher.

Loading and Configuring the Task Manager

You can load and configure the Task Manager using SETUP (or INSTALL). SETUP will add a statement to AUTOEXEC.BAT to load TASKMGR.EXE and will also provide the necessary memory management. Once loaded, the program is available at any time; there is no need to load it at the system prompt every time you want to use it.

You can load the Task Manager at the system prompt using the TASKMGR command. If you are loading the task switcher only, you can configure the Task Manager this way. To load the Task Manager at the system prompt as a multitasker, the EMM386 memory manager must be configured for multitasking with the /MULTI switch. When you use the TASKMGR command, the program will only remain available until the next time you boot the machine.

Using SETUP to Load the Task Manager

Start SETUP and choose Task Management from the main menu. You can then set options for the Task Manager. If you are using the Task Manager as a task switcher only, you can also specify the type of memory you want the Task Manager to use. SETUP automatically updates the appropriate files (TASKMGR.INI, AUTOEXEC.BAT, and the EMM386 memory manager in CONFIG.SYS) when you exit the program. The next time you boot your machine, the changes take effect and the Task Manager is loaded automatically and as you specified in SETUP.

Note: If you are using a computer which also has Windows 95 installed, AUTOEXEC.BAT and CONFIG.SYS are replaced by AUTODOS7.BAT and DCONFIG.SYS. In this manual, wherever these file are mentioned, replace them with AUTODOS7.BAT and DCONFIG.SYS.

Multitasking or Task Switching

Choose to load either the multitasking or the task switching software. To use the multitasking software, your computer must have at least a 386 processor.

Task Manager Options

After you choose to load either the multitasking or the task switching software, choose to configure the Task Manager. You can set the following options:

NOTE: If you are loading the task switcher only and if you are going to load GeoWorks as a task, you must use <Ctrl><Esc> because GeoWorks intercepts all other key combinations. If you are using MS Windows with the task switcher, specify a key combination other than <Ctrl><Esc>.

You can also set the following option, if you are loading the multitasking software:

You can set the following options if you are loading the task switcher only:

Allocating Memory for the Task Manager (Task Switching Only)

The Task Manager can use extended or expanded (EMS) memory, rather than conventional memory, if these memory types are available. Refer to Chapter 10, "Managing Memory" for information about enabling extended or expanded memory.

The Task Manager uses extended memory, if available, by default. You can change the amount of extended memory to reserve for the program; by default, 1024 KB is reserved. You can also specify 0 KB to disable the use of extended memory.

If you want the Task Manager to use expanded memory, specify the amount of expanded memory to reserve for the program. The default is 0 KB (use of expanded memory is disabled).

To change memory settings for the multitasker, you must edit the TASKMGR.INI file directly. Refer to the following section, "Changes Made by SETUP" for information about TASKMGR.INI.

Limiting the Amount of Memory Used per Task

Whether you are using the multitasker or the task switcher, you can specify the maximum amount of extended or expanded memory that can be used by any single task. The limit you specify applies to whichever type of memory the Task Manager is configured to use. Some applications will try to allocate all the available extended or expanded memory to themselves when they load; in this case, there may not be any further memory available for other applications.

To change memory settings for the multitasker, you must edit the TASKMGR.INI file directly. Refer to the following section, "Changes Made by SETUP" for information about TASKMGR.INI.

Changes Made by SETUP

When you load and configure the Task Manager using SETUP, the appropriate changes are made to the TASKMGR.INI file, the AUTOEXEC.BAT file, and the EMM386 memory manager in CONFIG.SYS.

The TASKMGR.INI File

The configuration of the Task Manager is defined in a file called TASKMGR.INI, a special configuration file used only by the Task Manager. TASKMGR.INI is stored in the DRDOS directory by default or in the directory specified by the DRDOSCFG environment variable; you can specify a different directory for configuration files in SETUP. You can also set the DRDOSCFG variable yourself using the SET command; refer to the "Command Reference" chapter of DOSBook for a description of the SET command.

TASKMGR in AUTOEXEC.BAT

The TASKMGR command loads the Task Manager software. When you load and configure the Task Manager in SETUP, the TASKMGR command is automatically added to AUTOEXEC.BAT, so that the software loads every time you start the operating system. You can also use TASKMGR at the system prompt; refer to "Loading the Task Manager at the System Prompt" on page 13-7 and "Working with Tasks at the System Prompt" on page 13-14.

EMM386 DPMI Support (Multitasking Only)

If you load the multitasking software, DOS Protected Mode Interface (DPMI) support is also provided via the EMM386 memory manager. DPMI allows applications to access the protected mode features on 386 (and later) computers. The DPMI switch, which enables DPMI support to improve multitasker performance, is automatically added to EMM386 in CONFIG.SYS, along with the MULTI switch, when you choose to load the multitasking software in SETUP. Refer to Chapter 10, "Managing Memory" for more information about the EMM386 memory manager.

Task and System Environments

When you choose to load the Task Manager, be aware of the relationship between the local environment that each task creates and the operating system's global environment, which each task will inherit. If you load a TSR as a task, for example, it can only be used within the task and will only use memory available within that task. The Task Manager program is loaded into the global environment, which includes all currently-loaded device drivers, TSRs, and all currently available memory. Anything that you want all tasks to share must, therefore, be loaded before the Task Manager.

You should attempt to keep the number of programs loaded globally to a minimum because each program loaded before the Task Manager reduces the amount of memory available to the applications you load as tasks. Programs you should load before the Task Manager, however, could include the following:

Because the Task Manager is loaded in AUTOEXEC.BAT (by the TASKMGR command) and the statements in AUTOEXEC.BAT are processed in the order in which they appear, any changes to the global environment that you want all tasks to share must be located before the TASKMGR command. If necessary, you may need to edit the AUTOEXEC.BAT file yourself using EDIT or another text editor.

Using Disk Utilities

Before loading the Task Manager, you should also run any disk utilities (such as disk optimizers and disk editors) that you want to use. Some of these will work under the multitasker, but you may see a warning message when they load.

IMPORTANT: Using disk utilities while the Task Manager is loaded could result in disk corruption.

Loading the Task Manager at the System Prompt

You can load and configure the Task Manager at the system prompt, using the TASKMGR command. The changes you make using TASKMGR are only effective until the next time you boot your machine. Permanent loading and changes to the configuration of the Task Manager can only be made via SETUP or by editing TASKMGR.INI, AUTOEXEC.BAT, and CONFIG.SYS yourself. Refer to "Changes Made by SETUP" on page 13-4 for information about Task Manager configuration.

Different TASKMGR options are available depending on whether you previously loaded the multitasking or the task switching software using SETUP.

If the multitasking software is loaded, the only options available when loading the Task Manager at the system prompt are as follows:

TASKMGR [/?|/H] [/M] [/S?|/SH] [/S]
Command Switches

/? or /H

Displays help text for the multitasker.

/M

Allows you to switch tasks using the numeric keys on the keyboard, when you are using a keyboard that does not have a separate numeric keypad.

/S? or /SH

Displays help text for the task switcher only.

/S

Loads the task switcher instead of the multitasker, even if the multitasking software was enabled in SETUP.

If the multitasker is not enabled, use the TASKMGR command as follows:

TASKMGR [/?|/H] [/D=dirpath] [/E[=nnnn]] [/F] [/M]
[/V[:1]] [/X[=nnnn]]
Command Switches

/? or /H

Displays help text.

/D=dirpath

Specifies the location (dirpath) of the swap file. The swap file is used for storing suspended tasks when there is no RAM available. The default is C:\DRDOS\TMP.

/E[=nnnn]

Allocates the specified amount of extended memory (nnnn KB) to the Task Manager. Tasks will be swapped to extended memory. If you do not specify an amount, or if you specify an amount greater than the amount available, all the available extended memory is used. To disable the use of extended memory and reserve it for applications, specify /E=0.

/F

Saves user-defined fonts and code pages when you switch tasks.

/M

Allows you to switch tasks using the numeric keys on the keyboard, when you are using a keyboard that does not have a separate numeric keypad.

/V[:1]

Forces a VGA display to be accessed in the same way as an EGA display. Try /V:1 first, then /V if necessary.

/X[=nnnn]

Allocates the specified amount of expanded (EMS) memory (nnnn KB) to the Task Manager. Tasks will be swapped to expanded memory. If you do not specify an amount, or if you specify an amount greater than the amount available, all the available expanded memory is used. To disable the use of expanded memory and reserve it for applications, specify /X=0.

Using the Task Manager Menu

Press <Ctrl><Esc> (or the shift and hot key combination you specified during SETUP) to display the Task Manager menu.

The Task Manager menu appears in the top right corner of the screen. If you are running a graphics application, such as a drawing package, the screen clears before the menu appears; you return to the application when you exit the menu.

The menu has two parts: a task list on the left side, which lists the tasks you add, and an option list on the right side. The initial options (before you add any tasks) are About TaskMgr, Create new task, and Remove TaskMgr.

Select an option from the Task Manager menu by pressing the key shown to the right of the option; press <Del> to remove the Task Manager, for example. You can also select an option by clicking your mouse on it. Each of the menu options are explained in the following sections of this chapter.

NOTE: If you are using a non-enhanced keyboard, you can press <F2> and <F4> instead of <Ins> and <Del>.

When you display the menu before adding any tasks, the task list already contains one task, COMMAND, that represents your current session. Tasks are listed in the menu in the order in which you add them. Your current task (the one you are, or were most recently, using) is indicated by an arrow in the task list.

To move around the task list, use one of the following:

To cancel the Task Manager menu, press <Esc>. Cancelling the menu does not unload the Task Manager program; it simply removes the menu from the screen.

Adding Tasks

You can add tasks up to the limit of your available memory but you should limit the Task Manager to the tasks you use frequently.

A task, once loaded, remains loaded until you delete it, unload the Task Manager program, or reboot the computer. If you load a TSR as a task, the Task Manager automatically recognizes it as a TSR so that even when you are not running the program, it stays loaded as a task and appears in the Task Manager menu.

Before adding a task, make sure there is enough space for it. Check the amount of space already used by selecting the About TaskMgr option on the Task Manager menu; refer to "Showing the Space Available for Tasks" on page 13-11 for information about this option. Graphics applications can require up to 800 KB. If you try to add a task and there is not enough space for it, you see a warning message. Remove an existing task and continue.

To add a task, do the following:

1. Press <Ctrl><Esc> (or the shift and hot key combination you specified) to display the Task Manager menu.

2. Select the option to create a new task by pressing the <Ins> key or clicking your mouse on the option.

You return to the system prompt.

3. Display the Task Manager menu again.

There is now a second task called COMMAND in the task list and the option to delete a task now appears in the menu, replacing the option to remove the Task Manager. Press <Esc> to cancel the menu.

4. Start the application that you want to add as a task.

Start the application in the same way that you would normally start it; change to the appropriate drive and directory, for example, or run the appropriate batch file. As an example, start EDIT; type EDIT and press <Enter>.

EDIT (or whichever application you started) is now loaded as a task.

5. Once the application is loaded, the Task Manager menu can be displayed by pressing <Ctrl><Esc> (or the shift and hot key combination you specified) as before.

The application appears in the task list as the second task.

Note that the task name in the list can be a maximum of 8 characters long, so if the name of an application is longer than 8 characters, the Task Manager shows an abbreviated version of the name. Also, if the Task Manager cannot determine the name, you see Task n as the task name, where n is the number of the task in the list.

6. Continue to add applications between which you want to switch.

Remember that you can only switch between applications that you add as tasks to the Task Manager menu.

7. If you add the maximum number of tasks (20), the option to create a new task disappears from the menu so that you cannot add another task.

Adding COMMAND.COM as a Task

The Task Manager is designed for running multiple applications but you can also load several copies of the command processor (COMMAND.COM) as separate tasks. You can then use COMMAND at the system prompt to customize the local environment for each COMMAND.COM. Refer to the "Command Reference" chapter of DOSBook for information about using COMMAND.

NOTE: If you already have more than one copy of COMMAND.COM loaded before you load the Task Manager, you can only load the Task Manager from the original COMMAND.COM.

Showing the Space Available for Tasks

Select the About TaskMgr option on the Task Manager menu to see how much space your current tasks are using and how much space is left; this information is useful when you are deciding whether or not to add more tasks.

Switching Tasks

When you switch tasks, and if you are using the multitasking software, the task you leave continues to run. If you are using the task switching software only, the task you leave is suspended in the background and stored in memory or in the swap file.

NOTE: When you are using communications software such as electronic mail or file transfer, make sure you do not switch tasks while the communications software is sending or receiving data via the serial port on your computer; if you do, data may be lost. Use the application to stop the remote card sending data before you switch tasks or adjust the foreground/background ratio setting.

You switch between the tasks in the task list using the menu. Move the highlight bar to the task and press <Enter> or click your mouse on the task.

You can switch between tasks and bypass the menu by doing one of the following:

If you are using a keyboard that does not have a numeric keypad, add the /M switch to the TASKMGR command line in AUTOEXEC.BAT. Refer to "Loading the Task Manager at the System Prompt" on page 13-7 for information about the TASKMGR command switches.

Problems Switching Tasks?

If you try to switch tasks and get a message warning you that there is insufficient space available, save any changes you want to keep in the current application and exit from it.

If you try to switch tasks and the Task Manager does not switch or you try to display the Task Manager menu from within a task and you cannot, the current application may have taken control of the keyboard from the Task Manager; it is no longer interpreting your keystrokes because the application is intervening and reading the keystrokes directly.

Use the SETUP program to change the Task Manager shift key (<Ctrl> by default) to a different key or key combination; the preferred alternative is <Ctrl><Left-shift> (the <Left-shift> key is the <Shift> key on the left side of the keyboard).

If the problem still remains, refer to the documentation for the application; it may have a "system" option that selects the command processor, COMMAND.COM. Selecting this option will take you to the system prompt and you should then be able to switch tasks. When you switch back to the application's task, you must type EXIT <Enter> at the system prompt to return to the application itself.

Deleting Tasks

You can only delete a task when there is more than one task in the task list. When the system prompt is the only task (COMMAND), the option to delete a task is replaced by the option to remove the Task Manager.

To delete a task, do the following:

1. Switch to the task you want to delete.

2. Exit the application running as the task.

3. Display the Task Manager menu.

The name on the menu for the task you are deleting is replaced by COMMAND (representing the system prompt).

4. The task you are deleting is your current task, since it is the task you most recently used. Press <Del> to delete it or click your mouse on the option.

If you did not exit the application running as the task, you are asked whether you really want to delete it; type Y for YES or N for NO. Be careful; if you delete a task with open files, you may lose data.

5. After you delete a task, the task at the top of the task list becomes the current task.

Unloading the Task Manager Without Rebooting

To unload the Task Manager without rebooting the machine, do the following:

You return to the system prompt and the Task Manager is no longer loaded. The software is not removed from your hard disk, however; you can reload the Task Manager at any time by either rebooting the machine (if you previously loaded the Task Manager in SETUP) or by using the TASKMGR command. Refer to "Using SETUP to Load the Task Manager" on page 13-2 and "Loading the Task Manager at the System Prompt" on page 13-7 for more information.

Working with Tasks at the System Prompt

If you are using the multitasker, you can use the TASKMGR command at the system prompt to add and delete tasks without using the Task Manager menu. If you are using the task switching software only, you can also change the name of a task and specify a limit on the amount of expanded memory used by any single task.

Use the TASKMGR command as follows:

TASKMGR [/?|/H] [/C command] [/K:nn] [/L=nnnn]
[/N[:nn] name] [/N[:nn]]

If the multitasking software is loaded, /C and /K are the only switches you can use.
Command Switches

/? or /H

Displays help text.

/C command

Adds a task to the Task Manager menu, where command is the command or batch file that starts the application you are adding as a task. Specify command exactly as you would enter it at the system prompt. When you add a task using /C, make sure that you wait approximately 10 seconds before pressing any keys; this pause allows the Task Manager to regain control of the keyboard after the application you are adding loads.

/K:nn

Removes the specified task, where nn is the number of the task on the Task Manager menu. If you are using the multitasker, you cannot delete the current task.

/L=nnnn

Limits the amount of expanded memory (to nnnn KB) that any single task is able to use, when the Task Manager is configured to use expanded (EMS) memory.

/N[:nn] name

Names a task, which is either the current task (by default) or task nn on the Task Manager menu. The name you specify can be a maximum of eight characters in length. This name overrides the name automatically determined by the Task Manager when the task is created.

/N[:nn]

Restores the default task name, for either the current task (by default) or task nn on the Task Manager menu.

Rebooting While the Task Manager is Loaded

If you press <Ctrl><Alt><Del> while the Task Manager is loaded, or if you run SETUP and then restart the operating system, the computer will not reboot immediately. Instead, you are prompted to delete your current task. When all current tasks are deleted and you press <Ctrl><Alt><Del> again, you are asked to confirm that you want to remove the Task Manager.

This is a safety feature to prevent the computer from rebooting while several applications are running or suspended in the background with open files. You should avoid trying to reboot when you are working with a file; the application may be reading or writing the file.

Once the Task Manager has been removed, press <Ctrl><Alt><Del> again to reboot the computer.

Task Manager Troubleshooting

This section describes some common problems that you might experience when using the Task Manager and what you can do about them.

Cannot Run MS Windows as a Task

If you are using the multitasker, you can run MS Windows 3.1 as a task but in Standard mode only. If you are using the task switcher only, however, you can run MS Windows 3.1 as a task in either Standard or Enhanced mode. No earlier versions of MS Windows are supported.

Open File Limit Too Low

The operating system expects only one application to be loaded at a time so when you are using the Task Manager to load multiple applications, you may need to increase the limit to the number of files that can be open simultaneously. If the current limit is too low, you will see a message telling you that an application cannot start because of this.

To increase the open files limit, run SETUP to change the FILES value in CONFIG.SYS. The value you specify depends on the requirements of your applications; if a word processor and a spreadsheet, for example, require 20 files each, you must specify a value of at least 40. Refer to the documentation for your applications to determine the ideal number of open files required. Do not specify more than the required number because each file has memory assigned to it.

Errors Running Multiple Copies of the Same Application

If you load more than one copy of an application and you get an error message, the problem could be the result of either of the following:

Possible solution: Use the ATTRIB +R command to set the application's overlay and .EXE files to "read-only." An application uses overlay files when it cannot fit entirely into memory; the main file is loaded and the rest of the application is divided between overlay files, which are loaded into memory only when required. The documentation for your application should identify the overlay and .EXE files.

Possible solution: Refer to the documentation for the application to determine whether there is an environment variable you can use to specify where temporary files are created. Then use this variable to specify a different location for each temporary file. If the application creates its temporary files in the local directory (where it is loaded), load each copy of the application in a different directory.



[Front] [Prev Chapter] [Next Chapter]

info@caldera.com
Copyright © 1993, 1997, 1998 Caldera, Inc. All rights reserved.