Commit Graph

122 Commits

Author SHA1 Message Date
vsc
516a349aad only evaluate lists with a single character.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2214 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-04-08 15:36:53 +00:00
vsc
21f03da2cd fixes for message queues
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2208 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-04-04 11:28:59 +00:00
vsc
4c933b8d79 implement thread_cancel using signals
use duplicate_term instead of copy_term in throw: throw may lose
reference to term.


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2207 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-04-04 10:02:44 +00:00
vsc
f930fd3179 thread at_exit should be module aware.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2206 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-04-04 09:32:10 +00:00
pmoura
04682ef5f0 Fixed bug in the predicate thread_create/1 when the thread goal generates an exception.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2204 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-04-03 23:23:06 +00:00
pmoura
2462596050 Fixed missing argument in recorda/3 call.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2198 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-04-03 01:28:21 +00:00
pmoura
5d6ddc8026 Fixed two bugs when closing a thread: (1) register thread exit status before running the exit hooks; (2) incorrect register of exception exit status.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2197 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-04-03 01:22:47 +00:00
pmoura
f827e047c1 Fixed bug in the thread_create/3 predicate where the thread indentifer was not within scope of the at_exit/1 option.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2196 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-04-03 00:10:04 +00:00
pmoura
1acbfc4f80 Only register at_exit/1 hooks given by the programmer.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2195 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-04-03 00:02:24 +00:00
vsc
929ec2412f handle out of memory error at thread creation (obs from Paulo Moura).
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2190 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-04-02 17:37:07 +00:00
vsc
7aab33a153 fix at_exit and thread_at_exit (obs from Paulo Moura).
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2188 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-04-02 15:13:16 +00:00
pmoura
ff59818068 Reimplemented the message_queue_create/1-2 predicates and added new predicate message_queue_property/2 for compliance with the ISO Prolog Threads DTR.
Remove thread info when closing a detached thread.

Simplified creation of thread message queues.


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2174 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-03-31 18:41:36 +00:00
pmoura
8a318a5e83 Updated the implementation of the thread_detach/1 predicate to help ensure that threads already terminated at the time of the call are destroyed instead of becoming zombie threads.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2173 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-03-31 16:26:31 +00:00
pmoura
8a1cfeb770 Added support for the SWI-Prolog thread_create/3 option at_exit/1 (work in progress)
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2172 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-03-28 10:57:28 +00:00
vsc
bee5cd8c0b fix thread_dettach
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2168 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-03-26 14:51:41 +00:00
vsc
47d7eee66d ensure locking
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2161 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-03-25 00:15:05 +00:00
vsc
e2519f4e3a handle message_queue_create/1 with vars right
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2160 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-03-25 00:11:55 +00:00
vsc
7d6e7f2613 make sure thread messages go to user_error.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2159 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-03-24 23:54:32 +00:00
pmoura
9fbbb1e47a Corrected a bug in thread_property/2 due to the use of the broken definition of the auxiliary predicate '$current_thread'/1. Removed predicates '$current_thread'/1-2.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2114 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-02-24 12:40:40 +00:00
pmoura
045965e3ed Completed ISO DTR definition of the message_queue_create/2 predicate. Still commented out waiting for a bug fix when creating queues without using aliases.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2113 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-02-24 12:28:05 +00:00
pmoura
eac625e0ec Fixed a bug in the predicate threads/0 where some threads might not be listed if there are gaps between the identifiers of the existing threads (e.g. with threads 0, 1, 3 the thread 3 would not be listed).
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2112 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-02-23 11:31:13 +00:00
vsc
17d16e0b14 Big update to support more SICStus/SWI like message handling
fix YAPSHAREDIR
fix yap.tex (Bernd)


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2107 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-02-22 15:08:37 +00:00
pmoura
d39002c271 Work in progress in the implementation of a version of the message_queue_create/2 compliant with the ISO Threads DTR.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2085 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-02-09 13:04:32 +00:00
vsc
ff8213e506 make thread code more stable
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2063 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-01-27 11:01:07 +00:00
vsc
4ae454aac6 Will Benton's patches for Mac 64 bits.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2062 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-01-25 00:21:28 +00:00
vsc
637f381d94 valgrind it!
enable atom garbage collection.


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2055 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2008-01-23 17:57:56 +00:00
pmoura
b6b281684d Updated the definition of the built-in predicate mutex_property/2 to match the latest ISO Threads DTR.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1967 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-10-22 12:58:27 +00:00
pmoura
f9b0a9dde7 Added thread_send_message/1 built-in predicate.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1929 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-09-18 17:50:12 +00:00
vsc
82aad9ab75 fix thread_create and make chr
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1915 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-07-12 00:18:41 +00:00
pmoura
50e39bef80 Added the thread_create/1 built-in predicate specified in the ISO standardization proposal.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1904 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-06-19 10:55:35 +00:00
pmoura
b55f58f05f Predicate mutex_property/2: only return true aliases; do not return locked/2 properties when count is zero.
Added predicate mutex_create/2 and reimplemented predicate mutex_create/1.


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1850 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-03-18 14:15:53 +00:00
pmoura
0dd5091163 The predicate mutex_property/2 now returns for the property locked/2 thread aliases, when defined, instead of thread identifiers.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1849 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-03-18 13:10:23 +00:00
pmoura
35fb866f2d Draft implementation of mutex_property/2.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1847 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-03-16 09:38:48 +00:00
pmoura
2ffa06931e Corrected a typo on the thread_defaults/1 predicate. Changed representation of mutex aliases to be consistent with the representation of thread aliases. Added a '$check_mutex_or_alias'/2 predicate to simplify error checking of mutex predicates.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1791 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-01-28 16:00:31 +00:00
vsc
b3d9e88802 Fix typos across code
Change debugger to backtrack more alike byrd model
Fix typo in debugger option f


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1782 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-01-24 14:20:04 +00:00
pmoura
c837589385 Protect the predicate with_mutex/2 by using a mutex when updating the internal database. Also, use catch/3 instead of call_cleanup/2 as the later still seems to be buggy.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1772 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-01-08 11:30:38 +00:00
pmoura
9d3618393f Main thread cannot be cancelled (note that the predicate thread_cancel/1 is not yet operacional).
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1768 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-01-02 11:10:58 +00:00
pmoura
ca2723e71f Code clean-up.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1767 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-01-02 03:01:20 +00:00
pmoura
44adaf58cd Represent more thread properties internally. Updated predicate threads/0 to also show thread detached status.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1766 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-01-02 02:51:31 +00:00
pmoura
57c480e165 Added predicates thread_property/1-2. Implementation is still incomplete as some thread properties are not yet internally represented.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1765 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-01-01 19:40:17 +00:00
pmoura
7c82c1acb3 Added predicate '$check_thread_or_alias'/2 in order to simplify error checking for most thread predicates.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1764 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-01-01 18:11:24 +00:00
pmoura
2896253b4c Added error checking code to the predicates thread_exit/1 and thread_signal/2.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1763 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-01-01 17:20:56 +00:00
pmoura
bf002885d7 Support a single alias per thread. Added error checking code to the predicates thread_self/1 and thread_join/2.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1762 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-01-01 16:54:39 +00:00
pmoura
0711088664 Added error checking code to the predicate thread_detach/1.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1761 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-12-31 22:23:24 +00:00
pmoura
9825556096 Added predicates thread_default/1 and thread_set_default/1 (as specified in the current threads standardization proposal).
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1760 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-12-31 20:33:55 +00:00
pmoura
6e0c674f13 Added missing declaration for meta-predicate thread_create/2. Added support for consulting and defining the default value of detached/1 thread creation option.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1759 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-12-31 19:33:27 +00:00
pmoura
139e50a1ca Corrected some bugs in the implementation of thread_sleep/1. Changed implementation to make the call succeed and return immediately when the argument is zero or a negative value (matching the current threads standardization proposal).
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1757 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-12-31 16:10:29 +00:00
pmoura
8ddee740a4 Implemented the predicate with_mutex/2.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1751 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-12-30 10:49:37 +00:00
pmoura
326c64ff2c Added a new multi-threading predicate, threads/0, which prints a nicely formatted table of current threads and their status. Similar to the predicate with the same name on SWI-Prolog except that it does not join terminated threads.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1658 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-05-25 23:46:57 +00:00
vsc
51553d40f2 more thread fixes
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1655 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-05-25 17:35:49 +00:00
vsc
1d445a731d Fix termination conditions for failed and detached threads.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1654 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-05-25 16:57:21 +00:00
vsc
f5b9000018 include thread_sleep functionality.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1653 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-05-25 16:28:28 +00:00
pmoura
3b033eee50 More strict argument checking for thread predicates.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1652 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-05-25 10:46:23 +00:00
pmoura
4f6d13e8c0 Add thread_create/2 predicate (same as thread_create/3 using default options).
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1651 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-05-24 21:41:00 +00:00
pmoura
c5e3e3f528 Fixed use of thread defaults by the thread_create/3 predicate.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1650 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-05-24 15:27:45 +00:00
pmoura
cf28236537 Preliminary implementations of thread_defaults/1 and thread_set_defaults/1 for consulting/setting default sizes for new thread code areas.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1649 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-05-24 14:40:50 +00:00
vsc
326583c727 current_thread would report an error on a non-existing id or alias.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1636 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-05-18 16:46:43 +00:00
vsc
b54dd9e2b9 more thread stuff
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1631 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-05-04 18:46:50 +00:00
vsc
3b26b9603b fix thread_peek_message to understand aliases
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1607 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-04-22 11:51:38 +00:00
vsc
d8ccb42440 fix current_thread to make sure it uses the integer ID even with aliases.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1604 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-04-20 17:29:46 +00:00
vsc
30318bb60d Lots of fixes (check logfile for details
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1585 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-04-05 00:16:55 +00:00
vsc
8ed6f693bb code review
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1576 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2006-03-24 16:26:31 +00:00
vsc
b089ae2575 fix GPL
fix idb: stuff in coroutines.


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1267 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2005-03-15 18:29:25 +00:00
vsc
f6503f0100 fix multithreaded version
include new version of Ricardo's profiler
new predicat atomic_concat
allow multithreaded-debugging
small fixes


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1085 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2004-06-29 19:04:46 +00:00
vsc
ddc7b3a0bc a few more fixes to support timing and to improve message queues.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1012 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2004-03-02 16:44:58 +00:00
vsc
6027963867 more thread updates.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1001 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2004-02-21 20:25:45 +00:00
vsc
026bfb3c18 more thread fixes
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@997 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2004-02-19 19:24:46 +00:00
vsc
eec29d7c27 fix thread_signal
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@978 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2004-02-11 13:59:53 +00:00
vsc
c9247ce308 make thread_local compatible with dynamic
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@977 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2004-02-11 13:33:19 +00:00
vsc
acbf57f59d improve threads support
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@976 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2004-02-11 01:20:56 +00:00
vsc
9b84cdfe5d improved support for threads and code area allocation using malloc
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@965 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2004-02-05 16:57:02 +00:00
vsc
ba9876268f threads, clean signals, and much more...
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@957 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2004-01-23 02:23:51 +00:00