Bill Allombert on Mon, 30 Jun 2025 22:59:22 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Forprime and posix multithreading
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: Forprime and posix multithreading
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Mon, 30 Jun 2025 22:59:18 +0200
- Delivery-date: Mon, 30 Jun 2025 22:59:22 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=math.u-bordeaux.fr; s=2022; t=1751317160; bh=9kCA0pW7OgsS8CEgAFF3HT30ilBv7/7nBWgbZfA4itY=; h=Date:From:To:Subject:References:In-Reply-To:From; b=UWInWvYx0tBH+e6309ru/D5dkZrFf2e1fAIiPjJnfCU+rHL1F5Ncn6zJu2/MT2zcf whUsMu5LIVkz/Oec4KKChbfP0EhLM9+F7veQYIFSqQri1p5YIpofM8L8ZsKjHUlYmk FZ+TYlLZ+/Oey5dlnuH7rtA4+wHbxhyESZu+D6KXFp7fzFyGe9QV93hrcG+mpubOpW JGfScUO0fDjFfChAq8nboPNcrUTMrwa831YI2pcqpFM8uq/RpaoiDpGmJLaHtsGBB5 Wfh/9edAIirlzifrxE0WsB1YxTS7wtckb2bfYxTOk4ihgS4PaMZ4L3GkDUowgtgli8 CbEyr/25IDx50kr8h86cHnW+wDlE9/KDwQTU2e12hAYEzmVkxl/Lw+Me0CdUao73Ch s2AwZpizcsgGxFFItRH8fQAyTPqj1Xo8pDwn/cw9ptxdfbsdvag1XXaRTM9uzr3opU +5xvUNUEehO7IdJCMjzNIOLQ+M0qNsH5ran5i9Sd6AJBoIo0tkwoODSTt+xMnnlvPh bs523mZcjPv37dAxZcORtMQqQDGEz5y7j8UOcTKry781/n9MqD0LYpAYRGWCJ9g5XG zsbzNaZVWS1sowFhn6TIv25RZA2t1oYT45/aR+EL1dILStQcpAAzQPupNiwpNISqRg 5i2js3sgIfyYB99iyE8E2qws=
- In-reply-to: <FE2E92C8-9965-4C00-A31D-A84E619DB56C@gmail.com>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <CC55E33B-AF36-4AD3-B980-F930AACCDD2E@gmail.com> <FE2E92C8-9965-4C00-A31D-A84E619DB56C@gmail.com>
Hi Piercarlo,
You need to use pari_thread_alloc/pari_thread_start/pari_thread_close
to initialize the threads.
See the example file examples/thread.c.
This is documented in the appendix B of the libpari manual
Note that an alternative that wraps around pthread is examples/pari-mt.c, the
documentation is in chapter 4 of the Developer's Guide to the PARI library
If you are using Windows, I recommend to use the Windows subsystem for Linux for
running parallel code.
Cheers,
Bill.