Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
 

Manpage says otherwise:

If the time limit expires, select() returns 0

And some tutorial says:

On success, select() and pselect() return the number of file descriptors contained in the three returned descriptor sets (that is, the total number of bits that are set in readfds, writefds, exceptfds) which may be zero if the timeout expires before anything interesting happens.

I don't see how select should ever return 0 for a writable fd


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43096552", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43096552", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
 

That said, if this is actually a race between aioPoll and select we probably shoud ditch one?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43096723", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43096723", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
In reply to this post by David T Lewis
 

Tobias, you need to read the code to see why we can't ditch aioPoll. Perhaps we could ditch the select call in socketWritable, but we would need to test on all platforms. However, here's how you can see that select does indeed answer 0 for a writable socket on macOS (I'm using 10.13.6).

  1. compile a debug VM using the version immediately before this commit, making sure the build supplies -DAIO_DEBUG.
  2. run with logging turned on, e.g.
    $ ../build.macos64x64/squeak.cog.spur/SqueakDebug.app/Contents/MacOS/Squeak -aiolog trunk6-64.image
  3. run the following in a workspace
	[
		|  address port opt send1 recv2 sent |
		address := NetNameResolver addressForName: '127.0.0.1' timeout: 20.
		port := 31259.
		tcpSend := Socket newTCP.
		tcpSend setOption: 'SO_REUSEADDR' value: 1.
		self assert: 0 = tcpSend socketError description: 'Error occured while setting SO_REUSEADDR'.
		opt := tcpSend getOption: 'SO_REUSEADDR'.
		self assert: opt first isZero & opt last isZero not description: 'SO_REUSEADDR couldn''t be set'.
		tcpSend setOption: 'SO_REUSEPORT' value: 1.
		self assert: 0 = tcpSend socketError description: 'Error occured while setting SO_REUSEPORT'.
		opt := tcpSend getOption: 'SO_REUSEPORT'.
		self assert: opt first isZero & opt last isZero not description: 'SO_REUSEPORT couldn''t be set'.
		"tcpSend setOption: 'TCP_NODELAY' value: 1."
		send1 := UUID new.

		tcpRecv := Socket newTCP.
		tcpRecv setOption: 'SO_REUSEADDR' value: 1.
		self assert: 0 = tcpRecv socketError.
		tcpRecv setOption: 'SO_REUSEPORT' value: 1.
		self assert: 0 = tcpRecv socketError.
		tcpRecv setPort: port.
		self assert: port = tcpRecv localPort.
		recv2 := UUID new.

		recvProc := [| received |
			received := 0.
			tcpRecv waitForConnectionFor: 200000.
			[received < 16] whileTrue:
				[received := received + (tcpRecv receiveDataInto: recv2 startingAt: received + 1)
				"No need to yield here, because #receiveDataInto:startingAt: will either wait on the readSemaphore of the socket or signal an error." ]
			] newProcess.
		sendProc := [tcpSend connectTo: address port: port.
					   sent := tcpSend sendData: send1] newProcess.
		recvProc resume.
		sendProc resume.
		(Delay forMilliseconds: 200) wait.
		self 
			assert: sendProc isTerminated description: 'sendProc hasn''t terminated till the deadline';
			assert: recvProc isTerminated description: 'recvProc hasn''t terminated till the deadline';
			assert: 16 = sent description: ('{1} bytes were sent instead of 16' format: { sent });
			assert: send1 = recv2  description: 'sent and received bytes differ']
	ensure:
		[tcpSend ifNotNil: [ tcpSend destroy ].
		tcpRecv ifNotNil: [ tcpRecv destroy ].
		sendProc ifNotNil: [ sendProc terminate ].
		recvProc ifNotNil: [ recvProc terminate ]]```
4. notice how in the log you see
```   32032    0 sqUnixSocket.c:1141 sqSocketSendDone(16) !socketWritable
   32032    0 aio.c:521 aioHandle(16, dataHandler, 5/AIO_WX)
   32032    0 sqUnixSocket.c:749 socketStatus 16: Connected O_ASYNC|O_NONBLOCK
   32032    0 sqUnixSocket.c:480 dataHandler(16=16, 0x7ff901521f30, 4/AIO_W)
   32032    0 sqUnixSocket.c:499 notify 16 write
   32032    0 sqUnixSocket.c:1141 sqSocketSendDone(16) !socketWritable
   32032    0 aio.c:521 aioHandle(16, dataHandler, 5/AIO_WX)
   32032    0 sqUnixSocket.c:749 socketStatus 16: Connected O_ASYNC|O_NONBLOCK
   32032    0 sqUnixSocket.c:480 dataHandler(16=16, 0x7ff901521f30, 4/AIO_W)
   32032    0 sqUnixSocket.c:499 notify 16 write
   32032    0 sqUnixSocket.c:1141 sqSocketSendDone(16) !socketWritable
   32032    0 aio.c:521 aioHandle(16, dataHandler, 5/AIO_WX)
   32032    0 sqUnixSocket.c:749 socketStatus 16: Connected O_ASYNC|O_NONBLOCK
   32032    0 sqUnixSocket.c:480 dataHandler(16=16, 0x7ff901521f30, 4/AIO_W)
   32032    0 sqUnixSocket.c:499 notify 16 write
   32032    0 sqUnixSocket.c:1141 sqSocketSendDone(16) !socketWritable
   32032    0 aio.c:521 aioHandle(16, dataHandler, 5/AIO_WX)...```

and each line that says ```sqUnixSocket.c:1141 sqSocketSendDone(16) !socketWritable``` is proof that select is returning 0.  It comes form this:
```static int
socketWritable(int s)
{
  struct timeval tv = { 0, 0 }; // i.e. poll
  fd_set fds;

  FD_ZERO(&fds);
  FD_SET(s, &fds);
#ifdef AIO_DEBUG
  { int r = select(1, 0, &fds, 0, &tv);
    if (r < 0)
        perror("socketWritable: select(1,0,&fd,0,&poll)");
    return r > 0;
  }
#else
  return select(1, 0, &fds, 0, &tv) > 0;
#endif
}```
i.e. ```r > 0``` is always false, and since there is no output from the perror we can conclude that select must be answering 0.

Now compile a VM from this commit and see that the example now works and that the log looks healthy:
```  413959    0 sqUnixSocket.c:788 listenOnPortBacklogSize(18, 1)
  413959    0 aio.c:452 aioEnable(18): Elicit SIGIO via O_ASYNC/fcntl
  413959    0 aio.c:521 aioHandle(18, acceptHandler, 3/AIO_RX)
  413959    0 sqUnixSocket.c:757 socketStatus 18: WaitingForConnection O_ASYNC|O_NONBLOCK
  413959    0 sqUnixSocket.c:757 socketStatus 18: WaitingForConnection O_ASYNC|O_NONBLOCK
  413959    0 sqUnixSocket.c:757 socketStatus 16: Unconnected !fcntl(fd,F_GETFL,0) !!
  413959    0 sqUnixSocket.c:2226 connectToAddressSize(16)
  413959    0 aio.c:452 aioEnable(16): Elicit SIGIO via O_ASYNC/fcntl
  413959    0 sqUnixSocket.c:2245 connect() => -1
  413959    0 aio.c:521 aioHandle(16, connectHandler, 5/AIO_WX)
  413961    2 sqUnixSocket.c:757 socketStatus 16: WaitingForConnection O_ASYNC|O_NONBLOCK
  413961    0 sqUnixSocket.c:445 connectHandler(16, 0x7fd0b34e2b90, 4)
  413961    0 sqUnixSocket.c:470 notify 16 conn
  413961    0 sqUnixSocket.c:388 acceptHandler(18, 0x7fd0b34e2ca0 ,2)
  413961    0 aio.c:565 aioDisable(18)
  413961    0 aio.c:545 aioSuspend(18)
  413961    0 aio.c:452 aioEnable(19): Elicit SIGIO via O_ASYNC/fcntl
  413961    0 sqUnixSocket.c:435 notify 19 conn
  413961    0 sqUnixSocket.c:757 socketStatus 19: Connected O_ASYNC|O_NONBLOCK
  413961    0 aio.c:521 aioHandle(19, dataHandler, 3/AIO_RX)
  413961    0 sqUnixSocket.c:1134 receiveDataAvailable(19) -> false [aioHandle is set]
  413961    0 sqUnixSocket.c:757 socketStatus 19: Connected O_ASYNC|O_NONBLOCK
  413961    0 sqUnixSocket.c:757 socketStatus 16: Connected O_ASYNC|O_NONBLOCK
  413961    0 sqUnixSocket.c:1151 sqSocketSendDone(16) !socketWritable
  413961    0 aio.c:521 aioHandle(16, dataHandler, 5/AIO_WX)
  413961    0 sqUnixSocket.c:757 socketStatus 16: Connected O_ASYNC|O_NONBLOCK
  413961    0 sqUnixSocket.c:481 dataHandler(16=16, 0x7fd0b34e2b90, 4/AIO_W)
  413961    0 sqUnixSocket.c:501 notify 16 write
  413961    0 sqUnixSocket.c:1242 TCP sendData(16, 16)
  413961    0 sqUnixSocket.c:1262 sendData(16) done = 16
  413961    0 sqUnixSocket.c:481 dataHandler(19=19, 0x7fd0b34e2ca0, 2/AIO_R)
  413961    0 sqUnixSocket.c:498 notify 19 read
  413961    0 sqUnixSocket.c:1120 receiveDataAvailable(19) -> true
  413961    0 sqUnixSocket.c:1208 receiveData(19) done = 16
  414163  202 sqUnixSocket.c:757 socketStatus 16: Connected O_ASYNC|O_NONBLOCK
  414163    0 sqUnixSocket.c:1000 destroy(16)
  414163    0 sqUnixSocket.c:983 abortConnection(16)
  414163    0 sqUnixSocket.c:945 closeConnection(16)
  414163    0 aio.c:565 aioDisable(16)
  414163    0 aio.c:545 aioSuspend(16)
  414163    0 sqUnixSocket.c:965 closeConnection: disconnected
  414163    0 sqUnixSocket.c:757 socketStatus 19: Connected O_ASYNC|O_NONBLOCK
  414163    0 sqUnixSocket.c:1000 destroy(19)
  414163    0 sqUnixSocket.c:983 abortConnection(19)
  414163    0 sqUnixSocket.c:945 closeConnection(19)
  414163    0 aio.c:565 aioDisable(19)
  414163    0 aio.c:545 aioSuspend(19)
  414163    0 sqUnixSocket.c:965 closeConnection: disconnected```


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43098105", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43098105", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
In reply to this post by David T Lewis
 

(I looked into it per your request :))
I figured that ditching aioPoll might not work; that said, I am not deep enough in this to understand why a writable socket might return 0. My brain start putting up "race condition?!?" warning signs, so there's that, but, ultimately, thats where my knowledge ends here


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43099489", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43099489", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
In reply to this post by David T Lewis
 

It's late but why do you hardcode the first parameter of select to 1? While I see your fd seems to be higher than 0?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43114203", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43114203", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
In reply to this post by David T Lewis
 

Hi Holger, first I don’t do anything. This code is historical. I’m simply trying to understand it and fix it. Second, the reason it’s 1 is that it’s testing for writability of a single file descriptor which happens to be that of a socket.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43121931", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43121931", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
In reply to this post by David T Lewis
 

The first parameter of select should be the largest file descriptor in the set + 1, so s + 1 in this case.
The original code had s + 1.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43122036", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43122036", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
In reply to this post by David T Lewis
 

The set has exactly one element, so this change is unnecessary.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43122146", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43122146", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
In reply to this post by David T Lewis
 

Hi shaping. That’s a misreading. The first argument is the number of file descriptors in the various fds arguments:

The nfds argument specifies the range of descriptors to be tested. The first nfds descriptors shall be checked in each set; that is, the descriptors from zero through nfds-1 in the descriptor sets shall be examined.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43123128", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43123128", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
In reply to this post by David T Lewis
 

Hi Eliot, it's me Levente.

My comment was about the comparison of select's return value with 1 instead of checking whether it's greater than 0.
If there is a file descriptor available for write in the set, the returned value always will be 1 since there's only one file descriptor in the set. So, == 1 is the same as > 0.

The first argument of select is ignored on windows: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-select#parameters
But on other systems (e.g. in sqUnixSocket.c), it should be set to

the highest-numbered file descriptor in any of the three sets, plus 1. The indicated file descriptors in each set are checked, up to this limit (but see BUGS).

See https://www.man7.org/linux/man-pages/man2/select.2.html.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43123372", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43123372", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
In reply to this post by David T Lewis
 

Hi Levente, oops, too many messages :-). I just wanted to make the Windows and Unix versions read the same. If you think == 1 is better than > 0 then I shall change both.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43124006", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43124006", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
In reply to this post by David T Lewis
 

Hi Holger, first I don’t do anything. This code is historical. I’m simply trying to understand it and fix it. Second, the reason it’s 1 is that it’s testing for writability of a single file descriptor which happens to be that of a socket.

The commit that replaced select(s+1, with select(1 seemed to have your name associated with it. I am sorry if I wrongly attributed this change to you. Calling the parameter "nfds" in the manpage is misleading and I wanted to probe if it was intentional that we set the "highest fd set in the fdset" to 0 (e.g. stdin) while the debug output showed fd numbers such as 18, 19.

But great that we resolved that.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43124918", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43124918", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
In reply to this post by David T Lewis
 

Okay, it makes sense to have the same code, but then the first argument should be s + 1.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43128984", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43128984", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
In reply to this post by David T Lewis
 

You’re quite right. I had misread. An improvement to socketWritable would be to use poll on Unix. And if would be very nice to have an aio.c alternative that used epoll.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43130976", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43130976", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
In reply to this post by David T Lewis
 

epoll wouldn't be a good choice, because many unix systems don't have it. I think libevent would be a much better choice, covering all currently supported operating systems (perhaps barring acorn. is that supported?), including windows: https://libevent.org/


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43131161", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43131161", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
In reply to this post by David T Lewis
 

Well platforms/Unix/vm/aio.c is only used on Unixes (Linux/Solaris/MacOS). I would be very happy to see a contribution using either epoll or libevent. Most conveniently if would be a replacement for all of aio.c in a different file name because this will be easier to read, and then we can rename aio,c to be say aioViaSelect.c, aioViaLibevent.c etc which can void their contents using an ifdef controlled by config.h


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43131447", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43131447", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
In reply to this post by David T Lewis
 

BTW, who am I talking to, smalltalking?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43131510", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43131510", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

David T Lewis
In reply to this post by David T Lewis
 

It's still me, Levente.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43133736", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/7deac028aeeb769c8782242fc23bebdfaaa58e3d#commitcomment-43133736", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Unix(macOS) SocketPlugin: (7deac02)

timrowledge
In reply to this post by David T Lewis
 
The RISC OS stuff does still work (non-cog, sadly) but claiming it is 'supported' would be a bit grandiose. I do have some RSIC OS Pi still but time to do anything with them is pretty much non-existent. And of course, it's not like RISC OS is going to suddenly become the world leading OS again.

> On 2020-10-10, at 6:31 AM, smalltalking <[hidden email]> wrote:
>
>
> epoll wouldn't be a good choice, because many unix systems don't have it. I think libevent would be a much better choice, covering all currently supported operating systems (perhaps barring acorn. is that supported?), including windows: https://libevent.org/
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub, or unsubscribe.
>


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: FR: Flip Record