From nobody Sun Jan 14 00:35:51 2024 X-Original-To: freebsd-threads@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCGXl6g5yz573rk for ; Sun, 14 Jan 2024 00:36:07 +0000 (UTC) (envelope-from vini.ipsmaker@gmail.com) Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TCGXl4wPTz4n5c; Sun, 14 Jan 2024 00:36:07 +0000 (UTC) (envelope-from vini.ipsmaker@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2cd84600920so40744721fa.1; Sat, 13 Jan 2024 16:36:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705192564; x=1705797364; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4F+mUBlQ0CERU/oXLCJ5tkwj5lLoYYGNW6LeWziMau0=; b=N3a4ihte5F2YBHP1D8xuAxzMSK+0o64X55aGJQFQP0hXUlEmB2p33uE9ijG0bOOUsY /ioWLdec2xDUSP9BYtwbBmFg0+beJ/KyAZTHBwRt9oedIPVlaWMSkL1SLU+3VLMn/gOy 9bI6oQ7MCJ2La1iQHBEBFonVLJULiecwGrxtAqKj/+p6nh7rcGch1QJ+p9ZniOPfJf+4 2ywkho7PrWwRgvDMv8hVpD9S5naqMgbiMvuewCfNHjO36BfEK0b+EFjRwk7jmo470ZFw yBhxcB/SXd20vL8dvKZtQpT9q9VMaNuVsVOETkKA7ZBPxd13SRBBvzHBjXMEGyiYRyCm 8HYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705192564; x=1705797364; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4F+mUBlQ0CERU/oXLCJ5tkwj5lLoYYGNW6LeWziMau0=; b=AQWEiJJ1ekiZAw08xEvrCyyJLw4sAxphE8GP9Y8eSVU2Ck9N6XxnSTpmRlpJzrDHLf XxeH759Vuki58/ZAC8pu/oWdVaEDy16Kir5aIEQEm+y8qgjncRD7odNawLeqLOuxJs6E me9i3vpRoYztjgrVvJZuaOBGyzkqEqqE5yMz36f74JAidmpi8QVCY7YS9D9J1YygxHtC Ijnj4OJtd+hAJJwScnCiMmfSYqkmpE9R6vlnxBOc1tg5bBYdoiBYiwYdCTDFI14dckAA uh2uNAbrdoIxvEPrBhZl6KN2ZhkbEkjaWW1YbJE8R08wHiBmko2V5MVUD+5bU6fqwJ0R AuCA== X-Gm-Message-State: AOJu0Yxg6GtpVkTNHcuYyrZUkJNTdRDI0Zd7cCpHdQM8MePyaELtzhOD Jqb+y3yPtffrvr61b7WT7qeVEl4wkr0PZxpjUvlAfay6Kks= X-Google-Smtp-Source: AGHT+IENavSTJc6mjczJ+hRzzqt6eL8mV0HjPqYeVPuYqoNHsjoK5q+1Ehrq2/3Pl4c6cZCCArZY7o3PlL0pZbIGW2k= X-Received: by 2002:a2e:869a:0:b0:2c9:d872:abd3 with SMTP id l26-20020a2e869a000000b002c9d872abd3mr1434019lji.81.1705192564395; Sat, 13 Jan 2024 16:36:04 -0800 (PST) List-Id: Threading List-Archive: https://lists.freebsd.org/archives/freebsd-threads List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-threads@freebsd.org X-BeenThere: freebsd-threads@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Vin=C3=ADcius_dos_Santos_Oliveira?= Date: Sat, 13 Jan 2024 21:35:51 -0300 Message-ID: Subject: Re: aio_read2() and aio_write2() To: Alan Somers Cc: freebsd-threads@freebsd.org, Konstantin Belousov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4TCGXl4wPTz4n5c X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] Em s=C3=A1b., 13 de jan. de 2024 =C3=A0s 21:23, Alan Somers escreveu: > If you shouldn't start a second stream until the first has finished, > the what is the reason for using AIO? This doesn't sound like a good > application for AIO to me. You use AIO on different files. AIO doesn't block the thread -- on FreeBSD with AIO daemons -- that initiated the (A)IO operation. The kernel is in the best position to judge how many threads should be used for file IO. It's best to leave this role with the kernel instead of the userspace process. The process remains unblocked to perform other concurrent tasks (e.g. socket IO through kqueue). Furthermore, Boost.Asio won't use AIO *just* for serial IO. Whenever possible, the application can use the random access interface as well (one can even mix both approaches for different files). It works fine on Linux and Windows. I don't see why FreeBSD should be special here. --=20 Vin=C3=ADcius dos Santos Oliveira https://vinipsmaker.github.io/