How about encoding PID with 0-9a-zA-Z or some other hash method? If you agree with this approach, I can get to implement it.
On Sun, Aug 23, 2020, 8:01 PM Waldek Hebisch <hebi...@math.uni.wroc.pl> wrote: > On Sat, Aug 22, 2020 at 10:41:50PM +0800, oldk1331 wrote: > > Okay, I take a different approach and try > > to workaround this problem in function > > "make_server_name": > > > > diff --git a/src/lib/sockio-c.c b/src/lib/sockio-c.c > > index 30e0eba5..a168129f 100644 > > --- a/src/lib/sockio-c.c > > +++ b/src/lib/sockio-c.c > > @@ -857,9 +857,21 @@ > > int > > make_server_name(char *name,char * base) > > { > > + /* Try to fit the contents of 'name' into char[14], > > + which is Sock::addr::u_addr::sa_data. > > + Normally 'base' is "/tmp/.x", so that leaves room > > + for 6 chars to put 'spad_server_number'/'SPADNUM', > > + which is the PID of sman. So use hexadecimal when > > + the PID is over 10^6. > > + */ > > Sorry, this is problematic: > > 1) 800000 hexadecimal is 8388608, so two different numbers give > the same name. The whole point of using PID is to make > sure there are no accidental collisions > 2) Hexadecimal buys us only factor of about 16 in magnitude. > Wait few years and this will be not enough (or may be > insufficient even now). In padding hack I made sure that > we have place for 64-bit PID. > > One may have objections to padding hack, but practicaly it > is more likely to work in long term than the proposal above. > > -- > Waldek Hebisch > > -- > You received this message because you are subscribed to the Google Groups > "FriCAS - computer algebra system" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to fricas-devel+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/fricas-devel/20200823120148.GA25524%40math.uni.wroc.pl > . > -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/CAGBJN91BHrHaW%2BXK5u%3Dc0NA_a2xpzwgOFS%2B3THoBsQ%3DaxV35Cw%40mail.gmail.com.