'Computer'에 해당되는 글 568건

  1. 2008.04.05 Signal (computing) by 알 수 없는 사용자
  2. 2008.04.05 Atomic operation by 알 수 없는 사용자
  3. 2008.04.05 exec (operating system) by 알 수 없는 사용자
  4. 2008.04.05 Copy-on-write by 알 수 없는 사용자
  5. 2008.04.05 Fork (operating system) by 알 수 없는 사용자
  6. 2008.04.05 Fork-exec by 알 수 없는 사용자 2
  7. 2008.04.05 SIGCHLD by 알 수 없는 사용자
  8. 2008.04.05 Apache Struts by 알 수 없는 사용자 1
  9. 2008.04.04 TFTP 패킷 크기 조정 by 알 수 없는 사용자
  10. 2008.04.04 윈도우에서 Ethereal로 loopback 인터페이스 패킷 캡쳐하기 by 알 수 없는 사용자 1

A signal is a limited form of inter-process communication used in Unix, Unix-like, and other POSIX-compliant operating systems. Essentially it is an asynchronous notification sent to a process in order to notify it of an event that occurred. When a signal is sent to a process, the operating system interrupts the process' normal flow of execution. Execution can be interrupted during any non-atomic instruction. If the process has previously registered a signal handler, that routine is executed. Otherwise the default signal handler is executed.

Reference:
http://en.wikipedia.org/wiki/Signal_handler
Posted by 알 수 없는 사용자
,

Atomic operation

Computer/Terms 2008. 4. 5. 21:03

An atomic operation in computer science refers to a set of operations that can be combined so that they appear to the rest of the system to be a single operation with only two possible outcomes: success or failure.

Reference:
http://en.wikipedia.org/wiki/Atomic_operation
Posted by 알 수 없는 사용자
,

The exec functions of Unix-like operating systems are a collection of functions that causes the running process to be completely replaced by the program passed as argument to the function. As a new process is not created, the process ID (PID) does not change across and execute, but the data, heap and stack of the calling process are replaced by those of the new process.

In the execl, execlp, execv, and execvp calls, the child process inherits the parent's environment.

Files open when an exec call is made remain open in the new process. All open files must be flushed before an exec call. The exec calls do not preserve the translation modes of open files. If the child process uses files inherited from the parent, setmode function can be called to set the translation mode to the desired mode.

In MS-DOS environments, a program executed with one of the exec functions is always loaded into memory as if the "maximum allocation" in the program's executable file header is set to default value 0xFFFF. The EXEHDR utility can be used to change the maximum allocation field of a program. However, if this is done and the program is invoked with one of the exec functions, the program might behave differently from a program invoked directly from the operating-system command line or with one of the spawn functions.

Many Unix shells also offer an "exec" built-in command that replaces the shell process with the specified program.

Prototypes
The functions are declared in unistd.h for POSIX standard and in process.h for DOS, OS/2, Windows.

int execl(const char *path, const char *arg0, ...);
int execle(const char *path, const char *arg0, ..., const char *const *envp);
int execlp(const char *path, const char *arg0, ...);
int execlpe(const char *path, const char *arg0, ...);
int execv(const char *path, const char *const *argv);
int execve(const char *path, const char *const *argv, const char *const *envp);
int execvp(const char *path, const char *const *argv);
int execvpe(const char *path, const char *const *argv, const char *const *envp);

Note: Some implementations provide these functions named with a leading underscore (e.g. _execl).

Function names
The base of each function is exec, followed by one or more letters:

e - An array of pointers to environment arguments is explicitly passed to the child process.
l - Command line arguments are passed individually to the function.
p - Uses the PATH argument variable to find the file to be executed.
v - Command line arguments are passed to the function as an array of pointers.

Path
The path argument specifies the path name of the file to execute as a child process. Arguments arg0 through argn are a list of pointers to arguments to be passed to the child process. argv is an array of pointers to arguments.

Envp
Argument envp is an array of pointers to environment settings. The execle, execlpe, execve, and execvpe calls alter the environment for the child process by passing a list of environment settings through the envp argument. This argument is an array of character pointers; each element (except for the final element) points to a null-terminated string defining an environment variable.

Each null-terminated string has the form:

name=value

where name is the environment variable name, and value is the value of that that variable. The final element of the envp array must be null. If envp itself is null, the child process inherits the environment settings of the parent process.

Reference:
http://en.wikipedia.org/wiki/Exec_%28operating_system%29

Posted by 알 수 없는 사용자
,

Copy-on-write

Computer/Terms 2008. 4. 5. 19:40

Copy-on-write (sometimes referred to as "COW") is an optimization strategy used in computer programming. The fundamental idea is that if multiple callers ask for resources which are initially indistinguishable, you can give them pointers to the same resource. This function can be maintained until a caller tries to modify its "copy" of the resource, at which point a true private copy is created to prevent the changes becoming visible to everyone else. All of this happens transparently to the callers. The primary advantage is that if a caller never makes any modifications, no private copy need ever be created.

Reference:
http://en.wikipedia.org/wiki/Copy-on-write
Posted by 알 수 없는 사용자
,

In computing, when a process forks, it creates a copy of itself, which is called a "child process." The original process is then called the "parent process". More generally, a fork in a multithreading environment means that a thread of execution is duplicated, creating a child thread from the parent thread.

Under Unix and Unix-like operating systems, the parent and the child operations are selected by examining the return value of the fork() system call. In the child process, the return value of fork() is 0, whereas the return value in the parent process is the PID of the newly-created child process.

The fork operation creates a separate address space for the child. The child process has an exact copy of all the memory segments of the parent process, though if copy-on-write semantics are implemented actual physical memory may not be assigned (i.e., both processes may share the same physical memory segments for a while). Both the parent and child processes possess the same code segments, but execute independently of each other.

Reference:
http://en.wikipedia.org/wiki/Fork_%28operating_system%29

Posted by 알 수 없는 사용자
,

Fork-exec

Computer/Terms 2008. 4. 5. 19:23

Fork-exec is a commonly used technique in Unix whereby an executing process spawns a new program. fork() is the name of the system call that the parent process uses to "divide" itself ("fork") into two identical processes. After calling fork(), the created child process is actually an exact copy of the parent - which would probably be of limited use - so it replaces itself with another process using the system call exec().

When a process forks, a complete copy of the executing program is made into the new process. This new process (which is a child of the parent) has a new process identifier (PID). The fork() function returns the child's PID to the parent, while it returns 0 to the child, in order to allow the two identical processes to distinguish from each other.

The parent process can either continue execution or wait for the child process to complete. The child, after discovering that it is the child, replaces itself completely with another program, so that the code and address space of the original program are lost.

If the parent chooses to wait for the child to die, then the parent will receive the exit code of the program that the child executed. Otherwise, the parent can ignore the child process and continue executing as it normally would; to prevent the child becoming a zombie it should wait on children at intervals or on SIGCHLD.

When the child process calls exec(), all data in the original program is lost, and replaced with a running copy of the new program. This is known as overlaying. Although all data is replaced, the file descriptors that were open in the parent are closed only if the program has explicitly marked them close-on-exec. This allows for the common practice of the parent creating a pipe prior to calling fork() and using it to communicate with the executed program.

Reference:
http://en.wikipedia.org/wiki/Fork-exec

Posted by 알 수 없는 사용자
,

SIGCHLD

Computer/Terms 2008. 4. 5. 19:07

On POSIX-compliant platforms, SIGCHLD is the signal sent by computer programs when a child process terminates. The symbolic constant for SIGCHLD is defined in the header file signal.h. Symbolic signal names are used because signal numbers can vary across platforms.

On Linux, SIGCLD is a synonym for SIGCHLD.

Usage
In Unix, a process can have children, created by fork or similar system calls. When the child terminates a SIGCHLD signal is sent to the parent. By default the signal is ignored and a zombie process is created. The parent must install a handler to act on the signal. Zombies can be avoided on some Unix platforms by explicitly ignoring SIGCHLD. This is shown in various languages in the table below. However, installing a signal handler for SIGCHLD and calling wait remain the most portable way to avoid zombies.

Reference:
http://en.wikipedia.org/wiki/SIGCHLD

Posted by 알 수 없는 사용자
,

Apache Struts

Computer/Terms 2008. 4. 5. 18:27

Apache Struts is a free open-source framework for creating Java web applications.

Web applications differ from conventional websites in that web applications can create a dynamic response. Many websites deliver only static pages. A web application can interact with databases and business logic engines to customize a response.

Web applications based on JavaServer Pages sometimes commingle database code, page design code, and control flow code. In practice, we find that unless these concerns are separated, larger applications become difficult to maintain.

One way to separate concerns in a software application is to use a Model-View-Controller (MVC) architecture. The Model represents the business or database code, the View represents the page design code, and the Controller represents the navigational code. The Struts framework is designed to help developers create web applications that utilize a MVC architecture.

The framework provides three key components:

A "request" handler provided by the application developer that is mapped to a standard URI.
A "response" handler that transfers control to another resource which completes the response.
A tag library that helps developers create interactive form-based applications with server pages.

The framework's architecture and tags are buzzword compliant. Struts works well with conventional REST applications and with nouveau technologies like SOAP and AJAX.



Apache Struts is an open-source web application framework for developing Java EE web applications. It uses and extends the Java Servlet API to encourage developers to adopt a model-view-controller (MVC) architecture. It was originally created by Craig McClanahan and donated to the Apache Foundation in May, 2000. Formerly located under the Apache Jakarta Project and known as Jakarta Struts, it became a top level Apache project in 2005.

Reference:
http://struts.apache.org/
http://en.wikipedia.org/wiki/Struts

Posted by 알 수 없는 사용자
,

TFTP RFC를 확인하면 패킷 크기는 512 바이트로 고정이라고 되어있다.

하지만 TFTP 확장 RFC를 보면 협상을 통해 바꿀 수 있음을 확인할 수 있다.

512 바이트의 패킷 크기로 대용량의 파일을 전송하는 일은 비효율적임은 당연하다.

패킷 처리에 대한 오버헤드는 물론이고,

TFTP는 데이터마다 ACK를 확인 후에 다음 데이터를 보내는 동기 방식이기 때문에

패킷 개수 * RRT의 시간이 네트워크에서 소요된다.

따라서 이를 최소화하기 위해서는 해당 매체의 MTU까지 채워서 보내는 것이 효율적이다.

Ethernet의 MTU는 1500바이트이고,

이 중에서 TFTP, UDP, IP 헤더를 제외하면,

최대 1428 바이트의 데이터를 하나의 프레임에 담아서 보낼 수 있다.

RFC 2348을 보면 패킷 크기 별 전송 소요 시간 비교가 나와있으니 참고하기 바란다.

하지만 패킷이 MTU 크기를 넘어가면,

IP 수준에서 fragmentation이 일어나기 때문에

이에 대한 부하가 발생한다.

fragmentation/defragmentation은

중간 경로 상에 IP 수준으로 처리하는 게이트웨이의 수가 많을수록 부하는 커진다.

MTU를 넘지 않는 수준에서 적당한 크기를 찾아야 할 것이다.

Reference:
ftp://ftp.rfc-editor.org/in-notes/rfc2348.txt
Posted by 알 수 없는 사용자
,

시도했으나, lookback 인터페이스가 선택 항목에 없어 구글링하다가,

결국 도움말을 보니, 다음과 같았다.

4.5.1. Capture frame
Interface
This field specifies the interface you want to capture on. You can only capture on one interface, and you can only capture on interfaces that Wireshark has found on the system. It is a drop-down list, so simply click on the button on the right hand side and select the interface you want. It defaults to the first non-loopback interface that supports capturing, and if there are none, the first loopback interface. On some systems, loopback interfaces cannot be used for capturing (loopback interfaces are not available on Windows platforms).

This field performs the same function as the -i <interface> command line option.

윈도우에서 네트워크 프로그램 디버깅은 뭘로 하나?

Posted by 알 수 없는 사용자
,