본문 바로가기

미국유학/CS 601 Principles of Software Dev

(6)
10.4 Lock `static lock`은 멀티스레드 환경에서 클래스 레벨에서 동기화를 위해 사용되는 개념입니다. 주로 Java에서 `static` 키워드를 사용하여 클래스에 대한 공유 자원을 여러 스레드가 동시에 접근하는 것을 막기 위해 동기화(synchronization)를 합니다.### `static lock` 개념1. **클래스 레벨 동기화**:    - `static lock`은 특정 인스턴스가 아닌 **클래스 자체에 대한 동기화**를 의미합니다.   - `static synchronized` 메서드 또는 `synchronized(staticLock)`과 같은 블록은 클래스 레벨의 잠금을 획득하여 동기화됩니다. 이 말은 **클래스의 모든 인스턴스가 동일한 락을 공유**한다는 뜻입니다.   2. **공유 리소스 ..
241003 PSD - Multithreading, Synchronization `andThen()`은 **Java**의 **`Consumer` 인터페이스**에서 제공하는 메소드 중 하나로, 두 개의 `Consumer`를 **연결**하여 **순차적으로** 실행할 수 있게 해주는 메소드입니다.### 기본적인 `Consumer` 설명:- **`Consumer`**는 **하나의 입력**을 받아서 어떤 동작을 수행하는 **함수형 인터페이스**입니다. 즉, 값을 받아서 처리하지만 그 값을 반환하지 않습니다. - **주로 `accept(T t)` 메소드를 통해 동작**합니다. 이 메소드는 입력을 받아서 그 값으로 어떤 처리를 수행하지만 결과를 반환하지 않는 메소드입니다.### `andThen()` 메소드의 역할:- **`andThen(Consumer after)`**는 **두 개의 `Consu..
241001 수업 , Thread package multithreading.basic;/** * Creates NUM_ROWS threads to search for the maximum value of a large matrix. Each * thread searches for max in one row of the matrix. Based on the example from * http://www.ibm.com/developerworks/java/tutorials/j-threads/j-threads.html */public class SolvingForMax { public final static int NUM_ROWS = 10; /** Inner class that represents a worker thread that..
Polymorphism (240905) 정적(Static) 메서드는 다형성을 따르지 않는다.
240903 Iterator Iterale은 인터페이스고,Iterator는 메서드지. 오버라이드 하는.      그리고Array는 Iterator를 쓸 수 없대. 그래서 iterator를 만들어 주는거야 inner class 로.       그리고 sealed interface라는게 있다3가지 경우에 가능하다.1)2) 3)
1st quiz LifeCycle Stages :       Requirement specification - Design - Coding - Testing - Deployment - Maintenance   SDLC - (1) Waterfall       1970s      Traditional Method for Software Development       Sequential      Requirement - Design - Implementation - Verification - Maintanence       First Two Phasees (20%-40%) , Coding (30%-40%)      Pros :             Provides a structured approach            ..