From: <cli...@li...> - 2009-02-05 12:08:19
|
Send clisp-cvs mailing list submissions to cli...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/clisp-cvs or, via email, send a message with subject or body 'help' to cli...@li... You can reach the person managing the list at cli...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of clisp-cvs digest..." CLISP CVS commits for today Today's Topics: 1. clisp/src ChangeLog, 1.6808, 1.6809 lispbibl.d, 1.856, 1.857 xthread.d, 1.20, 1.21 (Vladimir Tzankov) 2. clisp/src ChangeLog,1.6809,1.6810 spvw_genera1.d,1.37,1.38 (Vladimir Tzankov) 3. clisp/src ChangeLog,1.6810,1.6811 spvw_garcol.d,1.126,1.127 (Vladimir Tzankov) 4. clisp/src ChangeLog, 1.6811, 1.6812 lispbibl.d, 1.857, 1.858 spvw_global.d, 1.31, 1.32 (Vladimir Tzankov) 5. clisp/src ChangeLog,1.6812,1.6813 spvw_genera1.d,1.38,1.39 (Vladimir Tzankov) ---------------------------------------------------------------------- Message: 1 Date: Wed, 04 Feb 2009 12:21:19 +0000 From: Vladimir Tzankov <vt...@us...> Subject: clisp/src ChangeLog, 1.6808, 1.6809 lispbibl.d, 1.856, 1.857 xthread.d, 1.20, 1.21 To: cli...@li... Message-ID: <E1L...@dd...> Update of /cvsroot/clisp/clisp/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4156/src Modified Files: ChangeLog lispbibl.d xthread.d Log Message: fix debug multithread builds with stack allocated objects (set valid stack range for the current thread during GC) Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.6808 retrieving revision 1.6809 diff -u -d -r1.6808 -r1.6809 --- ChangeLog 4 Feb 2009 01:13:36 -0000 1.6808 +++ ChangeLog 4 Feb 2009 12:21:16 -0000 1.6809 @@ -1,5 +1,12 @@ 2009-02-04 Vladimir Tzankov <vtz...@gm...> + * lispbibl.d [MULTITHREAD]: export to clisp.h only the types + (PERFORM_GC)[MULTITHREAD]: set the valid stack range of current + thread in debug builds + * xthread.d (testandset) [MIPS]: fix the macro argument + +2009-02-04 Vladimir Tzankov <vtz...@gm...> + export low-level threads internals to clisp.h * xthread.d: convert all functions to macros in order to export them to clisp.h. POSIX mutexes code cleanup Index: lispbibl.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/lispbibl.d,v retrieving revision 1.856 retrieving revision 1.857 diff -u -d -r1.856 -r1.857 --- lispbibl.d 4 Feb 2009 01:13:37 -0000 1.856 +++ lispbibl.d 4 Feb 2009 12:21:17 -0000 1.857 @@ -6858,15 +6858,8 @@ %% #endif %% export_def(xthread_t); %% export_def(xthread_key_t); -%% export_def(xthread_key_get(k)); %% export_def(xmutex_t); -%% export_def(xmutex_lock(m)); -%% export_def(xmutex_unlock(m)); %% export_def(spinlock_t); -%% export_def(testandset(s)); -%% export_def(spinlock_acquire(s)); -%% export_def(spinlock_release(s)); -%% export_def(spinlock_tryacquire(s)); %% #endif /* forward declaration */ @@ -17372,21 +17365,25 @@ (this is needed since GC may be called from allocation or explicitly - when the heap lock is not held). */ #define WITH_STOPPED_WORLD(lock_heap,statement) \ - do { \ - var bool lh=lock_heap; \ - GC_STOP_WORLD(lh); \ - statement; \ - GC_RESUME_WORLD(lh); \ - } while(0) + do { \ + var bool lh=lock_heap; \ + GC_STOP_WORLD(lh); \ + statement; \ + GC_RESUME_WORLD(lh); \ + } while(0) #ifndef DEBUG_GCSAFETY - #define PERFORM_GC(statement,lock_heap) \ - WITH_STOPPED_WORLD(lock_heap,statement) + #define PERFORM_GC(statement,lock_heap) \ + do { \ + SET_SP_BEFORE_SUSPEND(current_thread()); \ + WITH_STOPPED_WORLD(lock_heap,statement); \ + } while(0) #else /* DEBUG_GCSAFETY */ /* if we trigger GC from allocate_xxxx, than we already have stopped the world and will resume it at exit.*/ #define PERFORM_GC(statement,lock_heap) \ - do {\ + do { \ + SET_SP_BEFORE_SUSPEND(current_thread()); \ if (lock_heap) WITH_STOPPED_WORLD(true,statement); else statement; \ }while(0) extern uintL* current_thread_alloccount(); Index: xthread.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/xthread.d,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- xthread.d 4 Feb 2009 01:13:37 -0000 1.20 +++ xthread.d 4 Feb 2009 12:21:17 -0000 1.21 @@ -339,7 +339,7 @@ } while(0) #endif #ifdef MIPS - #define testandset(int* spinlock) \ + #define testandset(spinlock) \ ({ long ret; \ long temp; \ __asm__ __volatile__("#Inline spinlock test & set" \ ------------------------------ Message: 2 Date: Wed, 04 Feb 2009 15:09:24 +0000 From: Vladimir Tzankov <vt...@us...> Subject: clisp/src ChangeLog,1.6809,1.6810 spvw_genera1.d,1.37,1.38 To: cli...@li... Message-ID: <E1L...@dd...> Update of /cvsroot/clisp/clisp/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31412/src Modified Files: ChangeLog spvw_genera1.d Log Message: (build_old_generation_cache) [MULTITHREAD]: fix page protection bug Index: spvw_genera1.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/spvw_genera1.d,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- spvw_genera1.d 7 Dec 2008 17:06:27 -0000 1.37 +++ spvw_genera1.d 4 Feb 2009 15:09:22 -0000 1.38 @@ -427,11 +427,14 @@ DEBUG_SPVW_ASSERT(protection == PROT_READ); end = gen0_end_pa; } else { - DEBUG_SPVW_ASSERT((protection == PROT_READ_WRITE) && - (start == rwarea->start)); - end = rwarea->start + rwarea->size; + if (protection == PROT_READ) { + end = rwarea->start; + } else { /* PROT_READ_WRITE */ + DEBUG_SPVW_ASSERT(start == rwarea->start); + end = rwarea->start + rwarea->size; + rwarea++; + } } - rwarea++; } while (1); goto prot_finished; #endif Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.6809 retrieving revision 1.6810 diff -u -d -r1.6809 -r1.6810 --- ChangeLog 4 Feb 2009 12:21:16 -0000 1.6809 +++ ChangeLog 4 Feb 2009 15:09:22 -0000 1.6810 @@ -1,5 +1,11 @@ 2009-02-04 Vladimir Tzankov <vtz...@gm...> + * spvw_genera1.d (build_old_generation_cache) [MULTITHREAD]: fix + page protection when multiple heap areas should be left with + PROT_READ_WRITE + +2009-02-04 Vladimir Tzankov <vtz...@gm...> + * lispbibl.d [MULTITHREAD]: export to clisp.h only the types (PERFORM_GC)[MULTITHREAD]: set the valid stack range of current thread in debug builds ------------------------------ Message: 3 Date: Wed, 04 Feb 2009 15:16:28 +0000 From: Vladimir Tzankov <vt...@us...> Subject: clisp/src ChangeLog,1.6810,1.6811 spvw_garcol.d,1.126,1.127 To: cli...@li... Message-ID: <E1L...@dd...> Update of /cvsroot/clisp/clisp/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32170/src Modified Files: ChangeLog spvw_garcol.d Log Message: (fill_relocation_memory_regions) [MULTITHREAD]: fix corner case: multiple times pinned object located at the start of the heap Index: spvw_garcol.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/spvw_garcol.d,v retrieving revision 1.126 retrieving revision 1.127 diff -u -d -r1.126 -r1.127 --- spvw_garcol.d 16 Jan 2009 15:34:03 -0000 1.126 +++ spvw_garcol.d 4 Feb 2009 15:16:26 -0000 1.127 @@ -1706,9 +1706,12 @@ var int i = 0; while (i<*count-1) { if (regs[i].start == regs[i+1].start) { - /* no way the sizes to differ */ - DEBUG_SPVW_ASSERT(regs[i].size == regs[i+1].size); - memmove(regs+i+1,regs+i+2,(*count-i-2)*sizeof(varobj_mem_region)); + /* no way the sizes to differ unless the pinned object is not + at the heap start and it's size is not initialized. in this case + we do not care. */ + DEBUG_SPVW_ASSERT((i==0) || (regs[i].size == regs[i+1].size)); + /* skip the current */ + memmove(regs+i,regs+i+1,(*count-i-2)*sizeof(varobj_mem_region)); (*count)--; mit--; continue; } @@ -1873,7 +1876,7 @@ var object threads_to_go; /* list of threads to be released */ var object mutexes_to_go; /* list of mutexes to be released */ var object exemptions_to_go; /* list of exemptions to be released */ - #endif + #endif /* MULTITHREAD */ set_break_sem_1(); /* disable BREAK during Garbage Collection */ gc_signalblock_on(); /* disable Signals during Garbage Collection */ gc_timer_on(); Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.6810 retrieving revision 1.6811 diff -u -d -r1.6810 -r1.6811 --- ChangeLog 4 Feb 2009 15:09:22 -0000 1.6810 +++ ChangeLog 4 Feb 2009 15:16:26 -0000 1.6811 @@ -1,5 +1,10 @@ 2009-02-04 Vladimir Tzankov <vtz...@gm...> + * spvw_garcol.d (fill_relocation_memory_regions) [MULITHREAD]: fix + corner case: multiple times pinned object at the start of the heap + +2009-02-04 Vladimir Tzankov <vtz...@gm...> + * spvw_genera1.d (build_old_generation_cache) [MULTITHREAD]: fix page protection when multiple heap areas should be left with PROT_READ_WRITE ------------------------------ Message: 4 Date: Thu, 05 Feb 2009 00:41:23 +0000 From: Vladimir Tzankov <vt...@us...> Subject: clisp/src ChangeLog, 1.6811, 1.6812 lispbibl.d, 1.857, 1.858 spvw_global.d, 1.31, 1.32 To: cli...@li... Message-ID: <E1L...@dd...> Update of /cvsroot/clisp/clisp/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32434/src Modified Files: ChangeLog lispbibl.d spvw_global.d Log Message: fix suspend_thread()/resume_thread() interaction with heap lock Index: spvw_global.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/spvw_global.d,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- spvw_global.d 8 Jan 2009 19:59:54 -0000 1.31 +++ spvw_global.d 5 Feb 2009 00:41:21 -0000 1.32 @@ -540,13 +540,15 @@ #define RELEASE_HEAP_LOCK() spinlock_release(&mem.alloc_lock) /* since the GC may be re-entrant we should keep track how many times - we have been called. Only the first time we have to really suspend other threads.*/ + we have been called. Only the first time we have to really suspend + other threads.*/ local uintC gc_suspend_count=0; -/* Suspends all running threads /besides the current/ on GC safe points/regions. - if lock_heap is true the heap is locked first. - (this is needed since GC may be called from allocation or explicitly - when - the heap lock is not held - the same for lock_thr) */ +/* UP: Suspends all running threads /besides the current/ at GC safe + points/regions. + > lock_heap: if false - the caller already owns the heap lock + At the end the heap lock is released since the GC itself may want + to allocate. */ global void gc_suspend_all_threads(bool lock_heap) { var clisp_thread_t *me=current_thread(); @@ -605,8 +607,9 @@ RELEASE_HEAP_LOCK(); } -/* Resumes all suspended threads /besides the current/ - should match a call to suspend_all_threads()*/ +/* UP: Resumed all suspended threads after GC (or world stop) + > unlock_heap: if true - the heap lock will be released at the end + should match a call to gc_suspend_all_threads()*/ global void gc_resume_all_threads(bool unlock_heap) { /* thread lock is locked. heap lock is free. */ @@ -647,8 +650,10 @@ if (unlock_heap) RELEASE_HEAP_LOCK(); } -/* resumes suspended thread (or just decreases the _suspend_count) - lock_heap specifies whether the caller DOES NOT own the heap spinlock */ +/* UP: Suspends single thread + > thr: the thread to be suspended + > lock_heap: if false - the caller already owns the heap lock + called from signal handler thread and from THREAD-INTERRUPT */ global void suspend_thread(clisp_thread_t *thr, bool lock_heap) { /* should never be called on ourselves */ @@ -668,15 +673,18 @@ thr->_suspend_count++; } unlock_threads(); - RELEASE_HEAP_LOCK(); + if (lock_heap) RELEASE_HEAP_LOCK(); } -/* resumes suspended thread (or just decreases the _suspend_count) - lock_heap specifies whether the caller DOES NOT own the heap spinlock */ -global void resume_thread(clisp_thread_t *thr, bool unlock_heap) + +/* UP: Resumes single thread (or just decreases it's _suspend_count). + > thr: the thread to be suspended + > lock_heap: if false - the caller already owns the heap lock + called from signal handler thread and from THREAD-INTERRUPT */ +global void resume_thread(clisp_thread_t *thr, bool lock_heap) { /* should never be called on ourselves */ ASSERT(thr != current_thread()); - ACQUIRE_HEAP_LOCK(); + if (lock_heap) ACQUIRE_HEAP_LOCK(); lock_threads(); /* blocks the GC - but not a problem */ if (thr->_STACK != NULL) { /* only if thread is alive */ if (! --thr->_suspend_count) { /* only if suspend count goes to zero */ @@ -685,7 +693,7 @@ } } unlock_threads(); - if (unlock_heap) RELEASE_HEAP_LOCK(); + if (lock_heap) RELEASE_HEAP_LOCK(); } Index: lispbibl.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/lispbibl.d,v retrieving revision 1.857 retrieving revision 1.858 diff -u -d -r1.857 -r1.858 --- lispbibl.d 4 Feb 2009 12:21:17 -0000 1.857 +++ lispbibl.d 5 Feb 2009 00:41:21 -0000 1.858 @@ -17265,20 +17265,26 @@ global void lock_threads(); /* unlocks global thread array */ global void unlock_threads(); -/* Suspends all running threads /besides the current/ on GC safe points/regions. - if lock_heap is true the heap is locked first. - (this is needed since GC may be called from allocation or explicitly - when - the heap lock is not held) */ +/* UP: Suspends all running threads /besides the current/ at GC safe + points/regions. + > lock_heap: if false - the caller already owns the heap lock + At the end the heap lock is released since the GC itself may want + to allocate. */ global void gc_suspend_all_threads(bool lock_heap); -/* Resumes all suspended threads /besides the current/ - should match a call to suspend_all_threads() */ +/* UP: Resumes all suspended threads after GC (or world stop) + > unlock_heap: if true - the heap lock will be released at the end + should match a call to gc_suspend_all_threads()*/ global void gc_resume_all_threads(bool unlock_heap); -/* suspends at safe point and increases the _suspend_count of the thread - lock_heap specifies whether the caller DOES NOT own the heap spinlock */ +/* UP: Suspends single thread + > thr: the thread to be suspended + > lock_heap: if false - the caller already owns the heap lock + called from signal handler thread and from THREAD-INTERRUPT */ global void suspend_thread(clisp_thread_t *thr, bool lock_heap); -/* resumes suspended thread (or just decreases the _suspend_count) - lock_heap specifies whether the caller DOES NOT own the heap spinlock */ -global void resume_thread(clisp_thread_t *thr, bool unlock_heap); +/* UP: Resumes single thread (or just decreases it's _suspend_count). + > thr: the thread to be suspended + > lock_heap: if false - the caller already owns the heap lock + called from signal handler thread and from THREAD-INTERRUPT */ +global void resume_thread(clisp_thread_t *thr, bool lock_heap); /* releases the clisp_thread_t memory of the list of Thread records */ global void release_threads (object list); /* releases the OS mutexes for mutex objects in the list */ Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.6811 retrieving revision 1.6812 diff -u -d -r1.6811 -r1.6812 --- ChangeLog 4 Feb 2009 15:16:26 -0000 1.6811 +++ ChangeLog 5 Feb 2009 00:41:20 -0000 1.6812 @@ -1,6 +1,13 @@ +2009-02-05 Vladimir Tzankov <vtz...@gm...> + + * spvw_global.d: comments + (suspend_thread): release heap lock only if it was acquired by us + (resume_thread): acquire heap lock only if not already owned + * lispbibl.d: comments + 2009-02-04 Vladimir Tzankov <vtz...@gm...> - * spvw_garcol.d (fill_relocation_memory_regions) [MULITHREAD]: fix + * spvw_garcol.d (fill_relocation_memory_regions) [MULTITHREAD]: fix corner case: multiple times pinned object at the start of the heap 2009-02-04 Vladimir Tzankov <vtz...@gm...> ------------------------------ Message: 5 Date: Thu, 05 Feb 2009 00:48:42 +0000 From: Vladimir Tzankov <vt...@us...> Subject: clisp/src ChangeLog,1.6812,1.6813 spvw_genera1.d,1.38,1.39 To: cli...@li... Message-ID: <E1L...@dd...> Update of /cvsroot/clisp/clisp/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2123/src Modified Files: ChangeLog spvw_genera1.d Log Message: (build_old_generation_cache) [MULTITHREAD]: fix page protection in case of many pinned objects in same physical memory page Index: spvw_genera1.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/spvw_genera1.d,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- spvw_genera1.d 4 Feb 2009 15:09:22 -0000 1.38 +++ spvw_genera1.d 5 Feb 2009 00:48:40 -0000 1.39 @@ -432,7 +432,19 @@ } else { /* PROT_READ_WRITE */ DEBUG_SPVW_ASSERT(start == rwarea->start); end = rwarea->start + rwarea->size; + /* advance rwarea. it is possible to have few pinned objects + (and so PROT_READ_WRITE areas) in singe physical page. In this + case we have "duplicated" rwarea items. skip not relevant ones + (or parts of them). */ rwarea++; + while (rwarea->start == (rwarea-1)->start) { + if (rwarea->size != (rwarea-1)->size) { + /* shrink it */ + rwarea->start += (rwarea-1)->size; + rwarea->size -= (rwarea-1)->size; + } else + rwarea++; + } } } } while (1); Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.6812 retrieving revision 1.6813 diff -u -d -r1.6812 -r1.6813 --- ChangeLog 5 Feb 2009 00:41:20 -0000 1.6812 +++ ChangeLog 5 Feb 2009 00:48:40 -0000 1.6813 @@ -1,5 +1,11 @@ 2009-02-05 Vladimir Tzankov <vtz...@gm...> + * spvw_genera1.d (build_old_generation_cache) [MULTITHREAD]: fix + page protection when multiple "writeable" (PROT_READ_WRITE) pinned + objects share the same physical memory page + +2009-02-05 Vladimir Tzankov <vtz...@gm...> + * spvw_global.d: comments (suspend_thread): release heap lock only if it was acquired by us (resume_thread): acquire heap lock only if not already owned ------------------------------ ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com ------------------------------ _______________________________________________ clisp-cvs mailing list cli...@li... https://lists.sourceforge.net/lists/listinfo/clisp-cvs End of clisp-cvs Digest, Vol 34, Issue 4 **************************************** |