On 23-Oct-08, at 1:17 PM, Claude Marinier wrote:
On Thu, 23 Oct 2008, Marc Feeley wrote:
To everyone on the list, if you have a non-Linux flavor of Unix (or an unusual Linux distribution or hardware), could you please try it out on your system and report any anomalies.
Looks good on Solaris 10 with recent Recommended patches and gcc (GCC) 3.4.6 on UltraSPARC (sun4u).
...
Thank you.
While we are on this topic, while working on a catalogue system (reads CSV, builds indexes, etc.), I was getting a deadlock error related to threads and was puzzled because I am not using threads. Is the heartbeat thread always running? Would it be related to this error? In the end, I re-wrote without using read-all and the error went away. Yes, it's not the best way to resolve problems but I am new to scheme and still feeling my way around.
The program's execution is under the control of the "primordial thread" and this is the only thread running by default. So, to be pedantic, all Gambit programs use threads, i.e. at least one. Gambit's scheduler detects deadlocks and reports them. A deadlock is when no thread can possibly make any progress in the future. For example:
% gsi -e "(define m (make-mutex)) (mutex-lock! m) (mutex-lock! m)" *** ERROR IN ##thread-deadlock-action! -- Deadlock detected
and also
% gsi -e (receive (i o) (open-string-pipe) (display "x" o) (pp (read- char i)) (pp (read-char i))) #\x *** ERROR IN ##thread-deadlock-action! -- Deadlock detected
In both cases the primordial thread blocks (in the first case trying to lock a locked mutex, in the second case trying to read from a pipe whose other end is still open), and there is no other thread that might unblock it (by unlocking the mutex or writing something to the pipe).
I'd have to look at your faulty code to see what situation caused the deadlock.
By the way, I plan to build a command line interface for the catalogue and later use Tcl/Tk for the GUI and Expect to manage the application. Do you know of open source Scheme code for command line processing?
No. But what exactly do you need as a command line interface? I think tcl/tk already provides basic editing commands for input fields. If you look at the code for my Javascript Scheme system (JSS) on the dumping grounds, you will see how to do basic line editing within a web page (which might be an interesting alternative to tcl/tk).
Thanks for a really good tool.
I'm glad you like it.
Marc
Afficher les réponses par date
On Thu, 23 Oct 2008, Marc Feeley wrote:
On 23-Oct-08, at 1:17 PM, Claude Marinier wrote:
By the way, I plan to build a command line interface for the catalogue and later use Tcl/Tk for the GUI and Expect to manage the application. Do you know of open source Scheme code for command line processing?
No. But what exactly do you need as a command line interface? I think tcl/tk already provides basic editing commands for input fields. If you look at the code for my Javascript Scheme system (JSS) on the dumping grounds, you will see how to do basic line editing within a web page (which might be an interesting alternative to tcl/tk).
Marc,
The program reads book records, builds an index (will build more later), and can search the index (using red-black trees). It is now time to build an interface so I can search the index and display books. I want to use a command line; I think they are quicker and more versatile. Perhaps I am revealing my age. :-) Later, I will add code to add books.
I would like the command line interface to be able to prompt for commands and data, read responses with some simple editing, and display results.
I do not need something as complex as 'libcli' but would like something better than dumb prompt and read.
http://dparrish.com/category/projects/libcli/
Thanks.
On Thu, 23 Oct 2008, Claude Marinier wrote:
On Thu, 23 Oct 2008, Marc Feeley wrote:
On 23-Oct-08, at 1:17 PM, Claude Marinier wrote:
By the way, I plan to build a command line interface for the catalogue and later use Tcl/Tk for the GUI and Expect to manage the application. Do you know of open source Scheme code for command line processing?
No. But what exactly do you need as a command line interface? I think tcl/tk already provides basic editing commands for input fields. If you look at the code for my Javascript Scheme system (JSS) on the dumping grounds, you will see how to do basic line editing within a web page (which might be an interesting alternative to tcl/tk).
Marc,
The program reads book records, builds an index (will build more later), and can search the index (using red-black trees). It is now time to build an interface so I can search the index and display books. I want to use a command line; I think they are quicker and more versatile. Perhaps I am revealing my age. :-) Later, I will add code to add books.
I would like the command line interface to be able to prompt for commands and data, read responses with some simple editing, and display results.
I do not need something as complex as 'libcli' but would like something better than dumb prompt and read.
I could just use 'rlwrap' which would save me a lot of work.
http://debaday.debian.net/index.php?s=rlwrap
On the other hand, I would not have the experience of working on the code.