Hi,
     Socket implementation in the VM already handles Async IO operations.
The execution model in Pharo is intended to have many concurrent green
threads (they are not OS threads, they are handled by Pharo VM). These
green threads are called processes in Pharo.
Pharo Green threads are quite cheap to create and use, and the context
switch of them is quite cheap also.
The programming model of Pharo is intended to have many concurrent green
threads, without caring if they block in tIO operations.
These block green threads are handled by the VM and the VM continue
executing useful code.
For orchestrating and communication between the green threads you can use
low-level synchronization as semaphores and mutex, but also there is a rich
library (Taskit) for using Asynchronous tasks, Callables and Futures.

Cheers,
Pablo


On Thu, Jul 22, 2021 at 8:57 AM <vin...@gmail.com> wrote:

> Can the Pharo VM or a library do a “select” on a collection of processes
> waiting on a socket or file IO? Something like
> https://man7.org/linux/man-pages/man2/select.2.html, or
> https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-select
> .
>
> Say I have a bunch of forked processes and some will get blocked waiting
> for IO. I would put the blocked connections/processes in a collection and
> non-blocked processes can continue to do useful work. At some appropriate I
> would do a select on the blocked processes and resume those that are done.
>
> Vince
>


-- 
Pablo Tesone.
teso...@gmail.com

Reply via email to