Login  Register

when safe to set maxExternalSemaphores:? What value?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

when safe to set maxExternalSemaphores:? What value?

Chris Muller-4
709 posts
Hi, the comment in maxExternalSemaphores: says:
_____
"Setting this at any time other than start-up can potentially lose requests.
i.e. during the realloc new storage is allocated,
the old contents are copied and then pointers are switched.
Requests occurring during copying won't be seen if they occur to indices already copied.
The intended use is to set the table to some adequate maximum at start-up"
_____

I could use some help in translating this to my limited user-level comprehension.  Does "start-up" here refer to the #startUp: hook?

Could "requests won't be seen" result in an image crash, or simply a few lost InputEvents?  If a crash is possible, I might be nervous to risk messing with it at all even in #startUp: in case it happened to be too low in the list, for example, and my image became unstartable..

Any guidance on what these external semaphores are for (at a high level) and a good suggested value for a chatty TCP/IP server would be greatly appreciated.

Thanks,
  Chris


Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: when safe to set maxExternalSemaphores:? What value?

Eliot Miranda-2
9490 posts
Hi Chris,

> On May 20, 2021, at 8:46 PM, Chris Muller <[hidden email]> wrote:
>
> Hi, the comment in maxExternalSemaphores: says:
> _____
> "Setting this at any time other than start-up can potentially lose requests.
> i.e. during the realloc new storage is allocated,
> the old contents are copied and then pointers are switched.
> Requests occurring during copying won't be seen if they occur to indices already copied.
> The intended use is to set the table to some adequate maximum at start-up"
> _____
>
> I could use some help in translating this to my limited user-level comprehension.  Does "start-up" here refer to the #startUp: hook?

Yes  Before the image starts listening for events.

>
> Could "requests won't be seen" result in an image crash, or simply a few lost InputEvents?  If a crash is possible, I might be nervous to risk messing with it at all even in #startUp: in case it happened to be too low in the list, for example, and my image became unstartable..

Simply lost input events.  And lost input events include e.g. notifications of readable socket data, etc.


>
> Any guidance on what these external semaphores are for (at a high level) and a good suggested value for a chatty TCP/IP server would be greatly appreciated.

They are used in the Semaphore implementation.  You’re probably using them already.

>
> Thanks,
>   Chris
>