Commit graph

54 commits

Author SHA1 Message Date
Daniel Kochmański
5e8ec11bdd cosmetic: fix indent (rest of C) 2016-05-06 08:41:52 +02:00
Matthew Mondor
8f07cd58d8 The ECL code no longer uses tabulator characters, they were replaced
by spaces.

A custom script was used to insert/replace Emacs and ViM per-file editor
settings according to their type and the new ECL coding style.
2015-09-03 07:35:47 -04:00
Daniel Kochmański
4d19a27424 cosmetic: untabify
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-21 14:38:20 +02:00
Juan Jose Garcia Ripoll
7a4a98d020 The owner of a lock now passes ownership to the first waiting process. 2012-07-30 22:49:56 +02:00
Juan Jose Garcia Ripoll
14d2960135 Use a spinlock for a thread wait until its process structure is completed by its parent. Rename waiting_for to woken_up for the real application it has. 2012-07-30 22:11:50 +02:00
Juan Jose Garcia Ripoll
0bc0dcf523 Remove statements that attempted at prioritizing the waiting queue and a bogus optimization that layed outside the appropriate locks 2012-07-29 22:03:32 +02:00
Juan Jose Garcia Ripoll
7638ca49ab Sacrifice fairness from the wait queue because otherwise we miss events. 2012-07-28 00:11:15 +02:00
Juan Jose Garcia Ripoll
23d5394a2e When a condition variable is signaled, it does not suffice to wakeup the process: we have to remove it. This is so because two consecutive calls to condition-variable-signal must delete two different processes. 2012-07-13 23:46:14 +02:00
Juan Jose Garcia Ripoll
595f3dbe58 The previous implementation of condition variables was wrong: it assumed that the signaling thread did not own the lock. 2012-07-11 00:06:33 +02:00
Juan Jose Garcia Ripoll
825fc8cbd3 Cnil and Ct are now part of legacy 2012-06-30 23:01:40 +02:00
Juan Jose Garcia-Ripoll
efadef99dc Prefix the block creation macros, ECL_BLOCK_*, etc 2012-06-30 12:01:44 +02:00
Juan Jose Garcia Ripoll
cb1cf92713 Rename ecl_fix() to ecl_fixnum(), just like ecl_long_float() or ecl_double_float() 2012-06-07 23:55:43 +02:00
Juan Jose Garcia Ripoll
64a9168434 CHARACTERP, BASE_CHAR_P, BASE_CHAR_CODE_P, CODE_CHAR, CHAR_CODE, REAL_TYPE, IMMEDIATE, IMMEDIATE_TAG, FIXNUM_TAG, FIXNUM_MINUSP, FIXNUM_PLUSP, FIXNUMP and fix get the ecl_ prefix 2012-06-06 11:19:55 +02:00
Juan Jose Garcia Ripoll
2fc1f35b51 Mingw has sched.h but does not work 2012-05-09 23:15:02 +02:00
Juanjo Garcia-Ripoll
57cd6e3066 Minor changes to add the new MP objects to the MSVC port and new code for waking up processes in this platform. 2012-04-16 23:35:40 +02:00
Juan Jose Garcia Ripoll
d93cefad6e Thanks to the chained wakeup event, ecl_wakeup_waiters() does no longer need an extra argument 2012-04-15 23:22:22 +02:00
Juan Jose Garcia Ripoll
d6f806af2c Update description of ecl_wait_on(). 2012-04-15 23:08:56 +02:00
Juan Jose Garcia Ripoll
323822457c In the queue, when the first process of the queue leaves it, it awakes the next one in line to test its condition. 2012-04-15 22:48:33 +02:00
Juan Jose Garcia Ripoll
a20b8b9218 ecl_wakeup_waiters now take an argument with the number of processes to awake 2012-04-15 11:09:42 +02:00
Juan Jose Garcia Ripoll
94c86a0af1 Simplified ecl_wait_on(): optimized detection of being first one and abortion, waking up is done with the lock held, woken up threads are not removed from queue. 2012-04-14 11:43:39 +02:00
Juan Jose Garcia Ripoll
51ca6d006e Simplify ecl_wakeup_waiters() 2012-04-12 23:59:34 +02:00
Juan Jose Garcia Ripoll
4c4b58c5cf Fixed various type warnings issued by Clang 2012-04-09 22:31:09 +02:00
Juan Jose Garcia Ripoll
c123b66245 ecl_wait_on() returns the value of the tester. 2012-04-06 23:51:00 +02:00
Juan Jose Garcia Ripoll
3980ea5d66 Removed the process.active field and instead used 'process.phase'. Added some debug statements. Threads are launched also with POSIX signals disabled (at least ECL's signal). 2012-04-06 18:07:58 +02:00
Juan Jose Garcia Ripoll
d161ac43f9 wakeup_one() did not use the spinlocks and had some additional implementation errors. 2012-04-06 12:08:47 +02:00
Juan Jose Garcia Ripoll
a5eb54dd27 Implemented mp:barrier and fixed unixsys.d to use spinlocks and not real locks. 2012-04-06 00:18:29 +02:00
Juan Jose Garcia Ripoll
7d97d8c817 Define ecl_process_yield() 2012-04-05 10:24:53 +02:00
Juan Jose Garcia Ripoll
e192df6069 Fixed order of arguments to pthread_sigmask() 2012-04-05 01:08:39 +02:00
Juan Jose Garcia Ripoll
e607b5c7f8 Fixed a typo in queue.d 2012-04-01 12:32:44 +02:00
Juan Jose Garcia Ripoll
1de1d7e428 ecl_wait_on() takes the environment as an argument 2012-03-31 11:25:56 +02:00
Juan Jose Garcia Ripoll
e278e1d5a7 When the lock is interrupted, we have to ensure that some thread is woken up. 2012-03-31 11:17:27 +02:00
Juan Jose Garcia Ripoll
008a260e1f In ecl_wait_on(), take care of the situation in which we abort waiting but do not care to acquire the lock: the other waiters must then be awoken. 2012-03-31 10:54:01 +02:00
Juan Jose Garcia Ripoll
e614f54a10 Resucitate the ecl_wait_on() implementation based on nanosleep(). 2012-03-29 22:45:58 +02:00
Juan Jose Garcia Ripoll
a5d1a4fdad Only block the process communication thread 2012-03-29 22:25:28 +02:00
Juan Jose Garcia Ripoll
616bcfcf0c Move the definition of sched_yield() up for scope reasons. 2012-03-29 19:34:12 +02:00
Juan Jose Garcia Ripoll
fc62d7927f Eliminated all of the remnants from the ecl_atomic_queue interface 2012-03-29 18:57:31 +02:00
Juan Jose Garcia Ripoll
328ac68f83 No need to create an extra cons for the wait queue 2012-03-29 18:50:58 +02:00
Juan Jose Garcia Ripoll
72fb2b575c Use the spinlock in the queue object and not in the cons 2012-03-29 18:33:58 +02:00
Juan Jose Garcia Ripoll
47b906b18f Do not pass the wait queue cons object around 2012-03-29 18:18:38 +02:00
Juan Jose Garcia Ripoll
5b1007c787 Change field names and introduce the spinlock in the lock structure 2012-03-29 17:43:27 +02:00
Juan Jose Garcia Ripoll
658d1c53ab Removed unused code and refactored all the queue code into queueu.d 2012-03-29 17:37:35 +02:00
Juan Jose Garcia Ripoll
4cf99dce0b Reuse the cons that is used for adding a process to a wait queue. 2012-03-29 15:25:59 +02:00
Juan Jose Garcia Ripoll
b9cebb0cf7 print_lock() is now more like printf(). New implementation of the queue. 2012-03-29 12:45:22 +02:00
Juan Jose Garcia Ripoll
76de423dcd Remove debug statements 2012-03-28 21:53:48 +02:00
Juan Jose Garcia Ripoll
a5661d8ad5 Do not try the atomic lock operation if there are processes waiting. 2012-03-27 22:55:02 +02:00
Juan Jose Garcia Ripoll
9ed7234c54 Debug wait queue 2012-03-23 23:23:53 +01:00
Juan Jose Garcia Ripoll
ad3b5ce069 Export spinlocks in internal.h 2012-03-23 22:30:19 +01:00
Juanjo Garcia-Ripoll
d0e9b4cd47 While a thread is booting: i) signals are ignored, ii) mp_process_join() and mp_process_kill() wait. 2012-03-20 17:46:31 +01:00
Juan Jose Garcia Ripoll
d54cbaa749 ecl_check_pending_interrupts() now takes the environment as argument
To wake up a process we need not supply any function (it is faster as it saves a call to queue_signal()
2012-03-20 00:02:47 +01:00
Juan Jose Garcia Ripoll
445431daa4 Mutexes and condition variables now rely on a queue for organizing waiters. 2012-03-19 01:14:22 +01:00