Return to site

Processes Monitor 1 1

broken image


2.1.3 Process Monitor (pmon) Process Monitor is another tool for Windows process performance monitoring that is primarily useful for real-time monitoring of process performance. It provides functionality similar to that of Task Manager but without any control over processes.

Conveniences for working with processes and the process dictionary.

  1. Process Monitor is even better when it comes to troubleshooting misbehaving applications. Suppose you're trying to run a program called app.exe, for instance, only it crashes immediately, and you don't know why. What's going on? Run Process Monitor first and it can show you exactly which files and Registry keys that app.exe is looking for.
  2. VISION-2000-E CVD or Etch Process Monitor, 1-200 amu, Multi-pressure & CVD/ALD. Viewing2 of 2 Products View All 2 Products. Vision 2000-C™ & E™ RGAs for Multi-pressure & CVD/ALD Processes. Vision 2000-C™-E™ XD High Sensitivity RGAs for Multi-pressure & CVD/ALD.

Besides the functions available in this module, the Kernel moduleexposes and auto-imports some basic functionality related to processesavailable through the following functions:

  • Kernel.spawn/1 and Kernel.spawn/3
  • Kernel.spawn_link/1 and Kernel.spawn_link/3
  • Kernel.spawn_monitor/1 and Kernel.spawn_monitor/3

While this module provides low-level conveniences to work with processes,developers typically use abstractions such as Agent, GenServer,Registry, Supervisor and Task for building their systems andresort to this module for gathering information, trapping exits, linksand monitoring.

Types

A process destination.

Functions

Monitor

Tells whether the given process is alive on the local node.

Cancels a timer returned by send_after/3.

Deletes the given key from the process dictionary.

Demonitors the monitor identified by the given reference.

Sends an exit signal with the given reason to pid.

Sets the given flag to value for the calling process.

Sets the given flag to value for the given process pid.

Returns all key-value pairs in the process dictionary.

Returns the value for the given key in the process dictionary,or default if key is not set.

Returns all keys in the process dictionary.

Returns all keys in the process dictionary that have the given value.

Deez nutz gaming. Returns the PID of the group leader for the calling process.

Sets the group leader of the given pid to leader.

Puts the calling process into a 'hibernation' state.

Returns information about the process identified by pid, or returns nil if the processis not alive.

Returns information about the process identified by pid,or returns nil if the process is not alive.

Creates a link between the calling process and the given item (process orport).

Returns a list of PIDs corresponding to all theprocesses currently existing on the local node.

Starts monitoring the given item from the calling process.

Stores the given key-value pair in the process dictionary.

Reads a timer created by send_after/3.

Registers the given pid_or_port under the given name.

Returns a list of names which have been registered using register/2.

Sends a message to the given dest.

Sends msg to dest after time milliseconds.

Sleeps the current process for the given timeout.

Spawns the given function according to the given options.

Spawns the given function fun from module mod, passing the given argsaccording to the given options.

Removes the link between the calling process and the given item (process orport).

Removes the registered name, associated with a PIDor a port identifier.

Returns the PID or port identifier registered under name or nil if thename is not registered.

Specs

A process destination.

A remote or local PID, a local port, a locally registered name, or a tuple inthe form of {registered_name, node} for a registered name at another node.

Specs

Specs

Specs

Tells whether the given process is alive on the local node.

If the process identified by pid is alive (that is, it's not exiting and hasnot exited yet) than this function returns true. Otherwise, it returnsfalse.

pid must refer to a process running on the local node or ArgumentError is raised.

Inlined by the compiler.

Specs

Cancels a timer returned by send_after/3.

When the result is an integer, it represents the time in millisecondsleft until the timer would have expired.

When the result is false, a timer corresponding to timer_ref could not befound. This can happen either because the timer expired, because it hasalready been canceled, or because timer_ref never corresponded to a timer.

Even if the timer had expired and the message was sent, this function does nottell you if the timeout message has arrived at its destination yet.

Inlined by the compiler.

Options

  • :async - (boolean) when false, the request for cancellation issynchronous. When true, the request for cancellation is asynchronous,meaning that the request to cancel the timer is issued and :ok isreturned right away. Defaults to false.

  • :info - (boolean) whether to return information about the timer beingcancelled. When the :async option is false and :info is true, theneither an integer or false (like described above) is returned. If:async is false and :info is false, :ok is returned. If :asyncis true and :info is true, a message in the form {:cancel_timer, timer_ref, result} (where result is an integer or false likedescribed above) is sent to the caller of this function when thecancellation has been performed. If :async is true and :info isfalse, no message is sent. Defaults to true.

Specs

Deletes the given key from the process dictionary.

Returns the value that was under key in the process dictionary,or nil if key was not stored in the process dictionary.

Examples

Specs

Demonitors the monitor identified by the given reference.

If monitor_ref is a reference which the calling processobtained by calling monitor/1, that monitoring is turned off.If the monitoring is already turned off, nothing happens.

See :erlang.demonitor/2 for more information.

Inlined by the compiler.

Examples

Specs

Sends an exit signal with the given reason to pid.

The following behaviour applies if reason is any term except :normalor :kill:

  1. If pid is not trapping exits, pid will exit with the givenreason.

  2. If pid is trapping exits, the exit signal is transformed into amessage {:EXIT, from, reason} and delivered to the message queueof pid.

If reason is the atom :normal, pid will not exit (unless pid isthe calling process, in which case it will exit with the reason :normal).If it is trapping exits, the exit signal is transformed into a message{:EXIT, from, :normal} and delivered to its message queue.

If reason is the atom :kill, that is if Process.exit(pid, :kill) is called,an untrappable exit signal is sent to pid which will unconditionally exitwith reason :killed.

Inlined by the compiler.

Examples

Specs

Sets the given flag to value for the calling process.

Returns the old value of flag.

See :erlang.process_flag/2 for more information.

Inlined by the compiler.

Specs

Sets the given flag to value for the given process pid.

Returns the old value of flag.

It raises ArgumentError if pid is not a local process.

The allowed values for flag are only a subset of those allowed in flag/2,namely :save_calls.

See :erlang.process_flag/3 for more information.

Inlined by the compiler.

Specs

Returns all key-value pairs in the process dictionary.

Inlined by the compiler.

Specs

Returns the value for the given key in the process dictionary,or default if key is not set.

Examples

Specs

Returns all keys in the process dictionary.

Inlined by the compiler.

Examples

Specs

Returns all keys in the process dictionary that have the given value.

Inlined by the compiler.

Specs

Returns the PID of the group leader for the calling process.

Inlined by the compiler.

Examples

Specs

Sets the group leader of the given pid to leader.

Typically, this is used when a process started from a certain shell shouldhave a group leader other than :init.

Inlined by the compiler.

Specs

Puts the calling process into a 'hibernation' state.

The calling process is put into a waiting statewhere its memory allocation has been reduced as much as possible,which is useful if the process does not expect to receive any messagesin the near future.

See :erlang.hibernate/3 for more information.

Inlined by the compiler.

Specs

Returns information about the process identified by pid, or returns nil if the processis not alive.

Use this only for debugging information.

See :erlang.process_info/1 for more information.

Specs

Returns information about the process identified by pid,or returns nil if the process is not alive.

See :erlang.process_info/2 for more information.

Specs

Creates a link between the calling process and the given item (process orport).

Links are bidirectional. Linked processes can be unlinked by using unlink/1.

If such a link exists already, this function does nothing since there can onlybe one link between two given processes. If a process tries to create a linkto itself, nothing will happen.

When two processes are linked, each one receives exit signals from the other(see also exit/2). Let's assume pid1 and pid2 are linked. If pid2exits with a reason other than :normal (which is also the exit reason usedwhen a process finishes its job) and pid1 is not trapping exits (seeflag/2), then pid1 will exit with the same reason as pid2 and in turnemit an exit signal to all its other linked processes. The behaviour whenpid1 is trapping exits is described in exit/2.

See :erlang.link/1 for more information.

Inlined by the compiler.

Specs

Returns a list of PIDs corresponding to all theprocesses currently existing on the local node.

Note that if a process is exiting, it is considered to exist but not bealive. This means that for such process, alive?/1 will return false butits PID will be part of the list of PIDs returned by this function.

See :erlang.processes/0 for more information.

Inlined by the compiler.

Examples

Specs

Starts monitoring the given item from the calling process.

Once the monitored process dies, a message is delivered to themonitoring process in the shape of:

where:

  • ref is a monitor reference returned by this function;
  • object is either a pid of the monitored process (if monitoringa PID) or {name, node} (if monitoring a remote or local name);
  • reason is the exit reason.

If the process is already dead when calling Process.monitor/1, a:DOWN message is delivered immediately.

See the need for monitoringfor an example. See :erlang.monitor/2 for more information.

Inlined by the compiler. Blocs 3 2 3. Roland dxy 990 drivers for mac.

Examples

Specs

Stores the given key-value pair in the process dictionary.

The return value of this function is the value that was previously storedunder key, or nil in case no value was stored under it.

Examples

Specs

Reads a timer created by send_after/3.

When the result is an integer, it represents the time in millisecondsleft until the timer will expire.

When the result is false, a timer corresponding to timer_ref could not befound. This can be either because the timer expired, because it has alreadybeen canceled, or because timer_ref never corresponded to a timer.

Even if the timer had expired and the message was sent, this function does nottell you if the timeout message has arrived at its destination yet.

Inlined by the compiler.

Specs

Registers the given pid_or_port under the given name.

name must be an atom and can then be used instead of thePID/port identifier when sending messages with Kernel.send/2.

register/2 will fail with ArgumentError in any of the following cases:

  • the PID/Port is not existing locally and alive
  • the name is already registered
  • the pid_or_port is already registered under a different name

The following names are reserved and cannot be assigned toprocesses nor ports:

  • nil
  • false
  • true
  • :undefined

Examples

Specs

Returns a list of names which have been registered using register/2.

Inlined by the compiler.

Examples

Specs

Sends a message to the given dest.

dest may be a remote or local PID, a local port, a locallyregistered name, or a tuple in the form of {registered_name, node} for aregistered name at another node.

Inlined by the compiler.

Options

  • :noconnect - when used, if sending the message would require anauto-connection to another node the message is not sent and :noconnect isreturned.

  • :nosuspend - when used, if sending the message would cause the sender tobe suspended the message is not sent and :nosuspend is returned.

Otherwise the message is sent and :ok is returned.

Examples

Monitor

Tells whether the given process is alive on the local node.

Cancels a timer returned by send_after/3.

Deletes the given key from the process dictionary.

Demonitors the monitor identified by the given reference.

Sends an exit signal with the given reason to pid.

Sets the given flag to value for the calling process.

Sets the given flag to value for the given process pid.

Returns all key-value pairs in the process dictionary.

Returns the value for the given key in the process dictionary,or default if key is not set.

Returns all keys in the process dictionary.

Returns all keys in the process dictionary that have the given value.

Deez nutz gaming. Returns the PID of the group leader for the calling process.

Sets the group leader of the given pid to leader.

Puts the calling process into a 'hibernation' state.

Returns information about the process identified by pid, or returns nil if the processis not alive.

Returns information about the process identified by pid,or returns nil if the process is not alive.

Creates a link between the calling process and the given item (process orport).

Returns a list of PIDs corresponding to all theprocesses currently existing on the local node.

Starts monitoring the given item from the calling process.

Stores the given key-value pair in the process dictionary.

Reads a timer created by send_after/3.

Registers the given pid_or_port under the given name.

Returns a list of names which have been registered using register/2.

Sends a message to the given dest.

Sends msg to dest after time milliseconds.

Sleeps the current process for the given timeout.

Spawns the given function according to the given options.

Spawns the given function fun from module mod, passing the given argsaccording to the given options.

Removes the link between the calling process and the given item (process orport).

Removes the registered name, associated with a PIDor a port identifier.

Returns the PID or port identifier registered under name or nil if thename is not registered.

Specs

A process destination.

A remote or local PID, a local port, a locally registered name, or a tuple inthe form of {registered_name, node} for a registered name at another node.

Specs

Specs

Specs

Tells whether the given process is alive on the local node.

If the process identified by pid is alive (that is, it's not exiting and hasnot exited yet) than this function returns true. Otherwise, it returnsfalse.

pid must refer to a process running on the local node or ArgumentError is raised.

Inlined by the compiler.

Specs

Cancels a timer returned by send_after/3.

When the result is an integer, it represents the time in millisecondsleft until the timer would have expired.

When the result is false, a timer corresponding to timer_ref could not befound. This can happen either because the timer expired, because it hasalready been canceled, or because timer_ref never corresponded to a timer.

Even if the timer had expired and the message was sent, this function does nottell you if the timeout message has arrived at its destination yet.

Inlined by the compiler.

Options

  • :async - (boolean) when false, the request for cancellation issynchronous. When true, the request for cancellation is asynchronous,meaning that the request to cancel the timer is issued and :ok isreturned right away. Defaults to false.

  • :info - (boolean) whether to return information about the timer beingcancelled. When the :async option is false and :info is true, theneither an integer or false (like described above) is returned. If:async is false and :info is false, :ok is returned. If :asyncis true and :info is true, a message in the form {:cancel_timer, timer_ref, result} (where result is an integer or false likedescribed above) is sent to the caller of this function when thecancellation has been performed. If :async is true and :info isfalse, no message is sent. Defaults to true.

Specs

Deletes the given key from the process dictionary.

Returns the value that was under key in the process dictionary,or nil if key was not stored in the process dictionary.

Examples

Specs

Demonitors the monitor identified by the given reference.

If monitor_ref is a reference which the calling processobtained by calling monitor/1, that monitoring is turned off.If the monitoring is already turned off, nothing happens.

See :erlang.demonitor/2 for more information.

Inlined by the compiler.

Examples

Specs

Sends an exit signal with the given reason to pid.

The following behaviour applies if reason is any term except :normalor :kill:

  1. If pid is not trapping exits, pid will exit with the givenreason.

  2. If pid is trapping exits, the exit signal is transformed into amessage {:EXIT, from, reason} and delivered to the message queueof pid.

If reason is the atom :normal, pid will not exit (unless pid isthe calling process, in which case it will exit with the reason :normal).If it is trapping exits, the exit signal is transformed into a message{:EXIT, from, :normal} and delivered to its message queue.

If reason is the atom :kill, that is if Process.exit(pid, :kill) is called,an untrappable exit signal is sent to pid which will unconditionally exitwith reason :killed.

Inlined by the compiler.

Examples

Specs

Sets the given flag to value for the calling process.

Returns the old value of flag.

See :erlang.process_flag/2 for more information.

Inlined by the compiler.

Specs

Sets the given flag to value for the given process pid.

Returns the old value of flag.

It raises ArgumentError if pid is not a local process.

The allowed values for flag are only a subset of those allowed in flag/2,namely :save_calls.

See :erlang.process_flag/3 for more information.

Inlined by the compiler.

Specs

Returns all key-value pairs in the process dictionary.

Inlined by the compiler.

Specs

Returns the value for the given key in the process dictionary,or default if key is not set.

Examples

Specs

Returns all keys in the process dictionary.

Inlined by the compiler.

Examples

Specs

Returns all keys in the process dictionary that have the given value.

Inlined by the compiler.

Specs

Returns the PID of the group leader for the calling process.

Inlined by the compiler.

Examples

Specs

Sets the group leader of the given pid to leader.

Typically, this is used when a process started from a certain shell shouldhave a group leader other than :init.

Inlined by the compiler.

Specs

Puts the calling process into a 'hibernation' state.

The calling process is put into a waiting statewhere its memory allocation has been reduced as much as possible,which is useful if the process does not expect to receive any messagesin the near future.

See :erlang.hibernate/3 for more information.

Inlined by the compiler.

Specs

Returns information about the process identified by pid, or returns nil if the processis not alive.

Use this only for debugging information.

See :erlang.process_info/1 for more information.

Specs

Returns information about the process identified by pid,or returns nil if the process is not alive.

See :erlang.process_info/2 for more information.

Specs

Creates a link between the calling process and the given item (process orport).

Links are bidirectional. Linked processes can be unlinked by using unlink/1.

If such a link exists already, this function does nothing since there can onlybe one link between two given processes. If a process tries to create a linkto itself, nothing will happen.

When two processes are linked, each one receives exit signals from the other(see also exit/2). Let's assume pid1 and pid2 are linked. If pid2exits with a reason other than :normal (which is also the exit reason usedwhen a process finishes its job) and pid1 is not trapping exits (seeflag/2), then pid1 will exit with the same reason as pid2 and in turnemit an exit signal to all its other linked processes. The behaviour whenpid1 is trapping exits is described in exit/2.

See :erlang.link/1 for more information.

Inlined by the compiler.

Specs

Returns a list of PIDs corresponding to all theprocesses currently existing on the local node.

Note that if a process is exiting, it is considered to exist but not bealive. This means that for such process, alive?/1 will return false butits PID will be part of the list of PIDs returned by this function.

See :erlang.processes/0 for more information.

Inlined by the compiler.

Examples

Specs

Starts monitoring the given item from the calling process.

Once the monitored process dies, a message is delivered to themonitoring process in the shape of:

where:

  • ref is a monitor reference returned by this function;
  • object is either a pid of the monitored process (if monitoringa PID) or {name, node} (if monitoring a remote or local name);
  • reason is the exit reason.

If the process is already dead when calling Process.monitor/1, a:DOWN message is delivered immediately.

See the need for monitoringfor an example. See :erlang.monitor/2 for more information.

Inlined by the compiler. Blocs 3 2 3. Roland dxy 990 drivers for mac.

Examples

Specs

Stores the given key-value pair in the process dictionary.

The return value of this function is the value that was previously storedunder key, or nil in case no value was stored under it.

Examples

Specs

Reads a timer created by send_after/3.

When the result is an integer, it represents the time in millisecondsleft until the timer will expire.

When the result is false, a timer corresponding to timer_ref could not befound. This can be either because the timer expired, because it has alreadybeen canceled, or because timer_ref never corresponded to a timer.

Even if the timer had expired and the message was sent, this function does nottell you if the timeout message has arrived at its destination yet.

Inlined by the compiler.

Specs

Registers the given pid_or_port under the given name.

name must be an atom and can then be used instead of thePID/port identifier when sending messages with Kernel.send/2.

register/2 will fail with ArgumentError in any of the following cases:

  • the PID/Port is not existing locally and alive
  • the name is already registered
  • the pid_or_port is already registered under a different name

The following names are reserved and cannot be assigned toprocesses nor ports:

  • nil
  • false
  • true
  • :undefined

Examples

Specs

Returns a list of names which have been registered using register/2.

Inlined by the compiler.

Examples

Specs

Sends a message to the given dest.

dest may be a remote or local PID, a local port, a locallyregistered name, or a tuple in the form of {registered_name, node} for aregistered name at another node.

Inlined by the compiler.

Options

  • :noconnect - when used, if sending the message would require anauto-connection to another node the message is not sent and :noconnect isreturned.

  • :nosuspend - when used, if sending the message would cause the sender tobe suspended the message is not sent and :nosuspend is returned.

Otherwise the message is sent and :ok is returned.

Examples

Specs

Sends msg to dest after time milliseconds.

If dest is a PID, it must be the PID of a local process, dead or alive.If dest is an atom, it must be the name of a registered processwhich is looked up at the time of delivery. No error is produced if the name doesnot refer to a process.

The message is not sent immediately. Therefore, dest can receive other messagesin-between even when time is 0.

This function returns a timer reference, which can be read with read_timer/1or canceled with cancel_timer/1.

The timer will be automatically canceled if the given dest is a PIDwhich is not alive or when the given PID exits. Note that timers will not beautomatically canceled when dest is an atom (as the atom resolution is doneon delivery).

Inlined by the compiler.

Options

  • :abs - (boolean) when false, time is treated as relative to thecurrent monotonic time. When true, time is the absolute value of theErlang monotonic time at which msg should be delivered to dest.To read more about Erlang monotonic time and other time-related concepts,look at the documentation for the System module. Defaults to false.

Examples

Specs

Processes Monitor 1 1 0

Sleeps the current process for the given timeout.

timeout is either the number of milliseconds to sleep as aninteger or the atom :infinity. When :infinity is given,the current process will sleep forever, and notconsume or reply to messages.

Use this function with extreme care. For almost all situationswhere you would use sleep/1 in Elixir, there is likely amore correct, faster and precise way of achieving the same withmessage passing.

Processes Monitor 1 1 X 4

For example, if you are waiting for a process to perform someaction, it is better to communicate the progress of such actionwith messages.

In other words, do not:

But do:

For cases like the one above, Task.async/1 and Task.await/2 arepreferred.

Similarly, if you are waiting for a process to terminate,monitor that process instead of sleeping. Do not:

Instead do:

Specs

Spawns the given function according to the given options.

The result depends on the given options. In particular,if :monitor is given as an option, it will return a tuplecontaining the PID and the monitoring reference, otherwisejust the spawned process PID.

More options are available; for the comprehensive list of available optionscheck :erlang.spawn_opt/4.

Inlined by the compiler.

Examples

Specs

Spawns the given function fun from module mod, passing the given argsaccording to the given options.

The result depends on the given options. In particular,if :monitor is given as an option, it will return a tuplecontaining the PID and the monitoring reference, otherwisejust the spawned process PID.

It also accepts extra options, for the list of available optionscheck :erlang.spawn_opt/4.

Inlined by the compiler.

Specs

Removes the link between the calling process and the given item (process orport).

If there is no such link, this function does nothing. If pid_or_port doesnot exist, this function does not produce any errors and simply does nothing.

The return value of this function is always true.

See :erlang.unlink/1 for more information.

Inlined by the compiler.

Specs

Removes the registered name, associated with a PIDor a port identifier.

Fails with ArgumentError if the name is not registeredto any PID or port.

Inlined by the compiler.

Examples

Processes Monitor 1 1 Inch

Specs

Returns the PID or port identifier registered under name or nil if thename is not registered.

Processes Monitor 1 1 =

See :erlang.whereis/1 for more information.

Examples





broken image