I have not met the races in graphics, but Ralf, Waldek and
I have all met the races in sman:
Namely, when building the book, sometimes there's a few lines
missing at the beginning or at the end of the tex file.
The tex file comes from spool file, which is the piped output
of "fricas" script.
This is quiet easily to reproduce if you build the book with
more jobs in parallel than the number of your threads of CPU.
First, the missing lines at the end.
sman kills all of its child processes if the FRICASsys quits.
For FRICASsys, its output goes to a pty, captured by "sman"
and forwards to "session" via socket, then "session" forward
to "spadclient" via socket, finally "spadclient" prints to
stdio.
So when FRICASsys outputs everything and quits, sometimes
sman kill everything while there's still a few final lines
in socket buffer, not printed out yet.
I solve this by adding sleep 100ms before "kill_all_children".
Second, for the missing liens at the beginning.
At startup, "spadclient" connects to "session", then "session"
connects to "FRICASsys" and get a prompt ("(1) -> ") back.
So after "connect_to_local_server", there's quite a few things
going on in the background. So it is necessary to sleep a while
before forwarding stdio (in this case, ")read xxx" from pipe)
to "FRICASsys". Otherwise sometimes the output order is messed up.
Ralf, please test if this fixes the build problem on your side.
- Qian
diff --git a/src/sman/sman.c b/src/sman/sman.c
index d5114624..05208cd3 100644
--- a/src/sman/sman.c
+++ b/src/sman/sman.c
@@ -773,9 +773,10 @@ monitor_children(void)
}
switch(proc->death_action) {
case Die:
+ fricas_sleep(100);
kill_all_children();
clean_up_sockets();
- fricas_sleep(200);
+ fricas_sleep(100);
exit(0);
case NadaDelShitsky:
break;
diff --git a/src/sman/spadclient.c b/src/sman/spadclient.c
index b0121181..0e3f5bb9 100644
--- a/src/sman/spadclient.c
+++ b/src/sman/spadclient.c
@@ -56,6 +56,7 @@ main(void)
{
sock = connect_to_local_server(SessionServer, InterpWindow, Forever);
bsdSignal(SIGINT, inter_handler,RestartSystemCalls);
+ fricas_sleep(60);
remote_stdio(sock);
return(0);
}
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/2454d345-7990-40ac-ab93-2a278ebb16a9%40gmail.com.