IRONSOFTWAREHOME
최대 평행 나사산 설정
using IronBarCode;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

List<string> imagePaths = new List<string>() { "sample_a.png", "sample_b.png" };

// Barcode reading options
BarcodeReaderOptions options = new BarcodeReaderOptions()
{
    // Set Max threads to 4
    Multithreaded = true,
    MaxParallelThreads = 4,
};

// Read barcode with multithreaded enabled
BarcodeResults results = BarcodeReader.Read(imagePaths, options);

Imports IronBarCode
Imports System
Imports System.Collections.Generic
Imports System.Threading.Tasks

Dim imagePaths As New List(Of String)() From {"sample_a.png", "sample_b.png"}

' Barcode reading options
Dim options As New BarcodeReaderOptions() With {
    .Multithreaded = True,
    .MaxParallelThreads = 4
}

' Read barcode with multithreaded enabled
Dim results As BarcodeResults = BarcodeReader.Read(imagePaths, options)
NuGet Download
PM > Install-Package BarCode
최대 평행 나사산 설정

최대 평행 나사산 설정

문서나 이미지를 순차적으로 대량 처리하는 것은 시간이 많이 걸리며 대량 응용 프로그램에서 병목 현상을 일으킬 수 있습니다. 병렬 스레드를 사용하면 응용 프로그램이 여러 이미지를 동시에 처리할 수 있어 전체 실행 시간을 크게 단축할 수 있습니다. 이 코드 예제에서는 IronBarcode를 설정하여 더 빠른 배치 바코드 읽기를 위해 멀티스레딩을 사용하는 방법을 보여줄 것입니다.

바코드를 읽기 위한 병렬 스레드 사용을 위한 5단계 가이드

  • using IronBarCode;
  • using System.Threading.Tasks;
  • List<string> imagePaths = new List<string>() { "sample_a.png", "sample_b.png" };
  • BarcodeReaderOptions options = new BarcodeReaderOptions(){ Multithreaded = true, MaxParallelThreads = 4 };
  • BarcodeResults results = BarcodeReader.Read(imagePaths, options);

코드 설명

먼저, IronBarcode 라이브러리와 스레드 네임스페이스가 가져오고 처리할 이미지의 파일 경로를 포함한 List<string>를 정의합니다. 위 예제에서는 "sample_a.png"와 "sample_b.png"가 스캔 준비되었습니다.

다음으로, 스캐닝 동작을 설정하기 위해 BarcodeReaderOptions 객체가 인스턴스화됩니다. 또한, 병렬 처리를 활성화하기 위해 ParallelProcessing 속성을 true로 설정합니다. Multithreaded MaxDegreeOfParallelism 속성 역시 4로 설정되어, 성능과 시스템 자원 사용의 균형을 유지하며 최대 4개의 동시 스레드를 사용하도록 리더에게 지시합니다. Multithreaded MaxParallelThreads MaxParallelThreads Read BarcodeReader.Read

마지막으로, 이미지 경로 목록과 구성된 옵션을 전달하여 BarcodeResults을(를) 검색하기 위해 ReadBarcodes가 호출됩니다.

IronBarcode로 최대 병렬 스레드를 설정하는 방법 배우기

시작할 준비 되셨나요?

Nuget Downloads 2,422,100버전:2026.9방금 출시

Key in blue circle

무료 30일 체험 키를 즉시 받으세요.

Your trial license will be sent to your email address

제한 없음. 100% 무제한 이용. 신용카드 불필요.

bullet_checked신용카드나 계정 생성은 필요하지 않습니다.제한 없음. 100% 무제한 이용. 신용카드 불필요.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
무료 라이브 데모를 예약하세요
Booking Badge

전 세계 수백만 엔지니어들이 신뢰하는 제품입니다.

Iron Software의 고객 로고
부담 없는 무료 상담을 받아보세요
아래 양식을 작성하시거나 sales@ironsoftware.com으로 이메일을 보내주세요.
고객님의 정보는 항상 비밀로 유지됩니다.
전 세계 수백만 엔지니어들이 신뢰하는 제품입니다.
Iron Software의 고객 로고
지금 바로 30일 무료 체험판 키를 받으세요.
신용카드나 계정 생성은 필요하지 않습니다.