|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
clisp-cvs Digest, Vol 42, Issue 19Send clisp-cvs mailing list submissions to
clisp-cvs@... 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 clisp-cvs-request@... You can reach the person managing the list at clisp-cvs-owner@... 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.7169,1.7170 spvw_fault.d,1.30,1.31 (Vladimir Tzankov) 2. clisp/src ChangeLog, 1.7170, 1.7171 spvw.d, 1.514, 1.515 spvw_sigwinch.d, 1.15, 1.16 (Vladimir Tzankov) ---------------------------------------------------------------------- Message: 1 Date: Wed, 21 Oct 2009 18:56:35 +0000 From: Vladimir Tzankov <vtz@...> Subject: clisp/src ChangeLog,1.7169,1.7170 spvw_fault.d,1.30,1.31 To: clisp-cvs@... Message-ID: <E1N0gMN-0005TQ-Tz@...> Update of /cvsroot/clisp/clisp/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20809/src Modified Files: ChangeLog spvw_fault.d Log Message: [MULTITHREAD]: simplify locking code when handling page faults Index: spvw_fault.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/spvw_fault.d,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- spvw_fault.d 8 Oct 2009 14:57:29 -0000 1.30 +++ spvw_fault.d 21 Oct 2009 18:56:33 -0000 1.31 @@ -99,6 +99,14 @@ return 0; } +#ifdef MULTITHREAD + #define LOCK_PAGE_CACHE(page) spinlock_acquire(&page->cache_lock) + #define UNLOCK_PAGE_CACHE(page) spinlock_release(&page->cache_lock) +#else + #define LOCK_PAGE_CACHE(page) + #define UNLOCK_PAGE_CACHE(page) +#endif + /* mapped generation: the old one */ #define heap_mgen_start heap_gen0_start #define heap_mgen_end heap_gen0_end @@ -136,24 +144,18 @@ { var int ret; var physpage_state_t* physpage = &heap->physpages[pageno]; - #if defined(MULTITHREAD) - spinlock_acquire(&physpage->cache_lock); - #endif + LOCK_PAGE_CACHE(physpage); switch (physpage->protection) { case PROT_NONE: /* protection: PROT_NONE -> PROT_READ */ ret=handle_read_fault(pa_address,physpage); - #if defined(MULTITHREAD) - spinlock_release(&physpage->cache_lock); - #endif + UNLOCK_PAGE_CACHE(physpage); if (ret < 0) goto error6; return handler_done; case PROT_READ: /* protection: PROT_READ -> PROT_READ_WRITE */ ret=handle_readwrite_fault(pa_address,physpage); - #if defined(MULTITHREAD) - spinlock_release(&physpage->cache_lock); - #endif + UNLOCK_PAGE_CACHE(physpage); if (ret < 0) goto error7; return handler_done; case PROT_READ_WRITE: @@ -162,22 +164,14 @@ PROT_READ or PROT_NONE, has changed to PROT_READ_WRITE while we were waiting to be executed. So we just return sucess here - other threads have done - what is required. - */ - #if defined(MULTITHREAD) - spinlock_release(&physpage->cache_lock); - #endif + what is required.*/ + UNLOCK_PAGE_CACHE(physpage); return handler_done; /* goto error8; */ default: - #if defined(MULTITHREAD) - spinlock_release(&physpage->cache_lock); - #endif + UNLOCK_PAGE_CACHE(physpage); goto error9; } - #if defined(MULTITHREAD) - spinlock_release(&physpage->cache_lock); - #endif error6: /* handle_read_fault() failed */ if (verbose) { var int saved_errno = OS_errno; @@ -250,9 +244,7 @@ var uintL pageno = (pa_address>>physpageshift) -(heap->heap_gen0_start>>physpageshift); var physpage_state_t* physpage = &heap->physpages[pageno]; - #if defined(MULTITHREAD) - spinlock_acquire(&physpage->cache_lock); - #endif + LOCK_PAGE_CACHE(physpage); if ((physpage->protection == PROT_NONE) && (prot == PROT_READ || prot == PROT_READ_WRITE)) { /* protection: PROT_NONE -> PROT_READ */ @@ -263,9 +255,7 @@ /* protection: PROT_READ -> PROT_READ_WRITE */ ret=handle_readwrite_fault(pa_address,physpage); } - #if defined(MULTITHREAD) - spinlock_release(&physpage->cache_lock); - #endif + UNLOCK_PAGE_CACHE(physpage); if (ret < 0) return false; } } @@ -286,4 +276,7 @@ } } +#undef LOCK_PAGE_CACHE +#undef UNLOCK_PAGE_CACHE + #endif /* GENERATIONAL_GC */ Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.7169 retrieving revision 1.7170 diff -u -d -r1.7169 -r1.7170 --- ChangeLog 20 Oct 2009 20:44:23 -0000 1.7169 +++ ChangeLog 21 Oct 2009 18:56:33 -0000 1.7170 @@ -1,3 +1,9 @@ +2009-10-21 Vladimir Tzankov <vtzankov@...> + + * spvw_fault.d (LOCK_PAGE_CACHE, UNLOCK_PAGE_CACHE): acquire/release + spinlock guarding physical page cache + (handle_fault, handle_fault_range): use them + 2009-10-20 Vladimir Tzankov <vtzankov@...> * lispbibl.d (jmpl_value) [MULTITHREAD]: make it per thread and export ------------------------------ Message: 2 Date: Wed, 21 Oct 2009 19:01:26 +0000 From: Vladimir Tzankov <vtz@...> Subject: clisp/src ChangeLog, 1.7170, 1.7171 spvw.d, 1.514, 1.515 spvw_sigwinch.d, 1.15, 1.16 To: clisp-cvs@... Message-ID: <E1N0gR4-0005fO-Tw@...> Update of /cvsroot/clisp/clisp/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21636/src Modified Files: ChangeLog spvw.d spvw_sigwinch.d Log Message: [MULTITHREAD]: handle SIGWINCH signal Index: spvw_sigwinch.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/spvw_sigwinch.d,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- spvw_sigwinch.d 3 Dec 2008 11:36:47 -0000 1.15 +++ spvw_sigwinch.d 21 Oct 2009 19:01:24 -0000 1.16 @@ -62,8 +62,11 @@ goto OK; if (false) { OK: - /* change value of SYS::*PRIN-LINELENGTH* : */ - Symbol_value(S(prin_linelength)) = fixnum(columns-1); + /* change value of SYS::*PRIN-LINELENGTH* : + NB: we always change the global value and do not use Symbol_value() + since in MT builds this function is called from signal handling thread + and there is no current_thread() */ + TheSymbol(S(prin_linelength))->symvalue = fixnum(columns-1); } } } Index: spvw.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/spvw.d,v retrieving revision 1.514 retrieving revision 1.515 diff -u -d -r1.514 -r1.515 --- spvw.d 20 Oct 2009 20:44:24 -0000 1.514 +++ spvw.d 21 Oct 2009 19:01:24 -0000 1.515 @@ -3784,16 +3784,16 @@ } } #endif + /* query the size of the terminal-window also now on program start: */ + #if defined(HAVE_SIGNALS) + update_linelength(); + #endif /* handling of async interrupts with single thread */ #if !defined(MULTITHREAD) /* establish interrupt-handler: */ #if defined(HAVE_SIGNALS) && defined(SIGWINCH) && !defined(NO_ASYNC_INTERRUPTS) install_sigwinch_handler(); #endif - /* query the size of the terminal-window also now on program start: */ - #if defined(HAVE_SIGNALS) - update_linelength(); - #endif #if (defined(HAVE_SIGNALS) && defined(UNIX)) || defined(WIN32_NATIVE) /* install Ctrl-C-Handler: */ install_sigint_handler(); @@ -4342,7 +4342,7 @@ sigaddset(&sigblock_mask,SIGTERM); #endif #if defined(SIGWINCH) - sigaddset(&sigblock_mask,SIGWINCH); + sigaddset(&sigblock_mask,SIGWINCH); #endif return sigblock_mask; } @@ -4687,7 +4687,7 @@ break; #if defined(SIGWINCH) case SIGWINCH: - /* TODO: imlpement. */ + sigwinch_handler(SIGWINCH); break; #endif #ifdef SIGTTOU Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.7170 retrieving revision 1.7171 diff -u -d -r1.7170 -r1.7171 --- ChangeLog 21 Oct 2009 18:56:33 -0000 1.7170 +++ ChangeLog 21 Oct 2009 19:01:24 -0000 1.7171 @@ -1,5 +1,13 @@ 2009-10-21 Vladimir Tzankov <vtzankov@...> + [MULTITHREAD]: handle SIGWINCH signal + * spvw_sigwinch.d (update_linelength): update SYS::*PRIN-LINELENGTH* + global value + * spvw.d (main): set SYS::*PRIN-LINELENGTH* in MT builds + (signal_handler_thread): handle SIGWINCH + +2009-10-21 Vladimir Tzankov <vtzankov@...> + * spvw_fault.d (LOCK_PAGE_CACHE, UNLOCK_PAGE_CACHE): acquire/release spinlock guarding physical page cache (handle_fault, handle_fault_range): use them ------------------------------ ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ------------------------------ _______________________________________________ clisp-cvs mailing list clisp-cvs@... https://lists.sourceforge.net/lists/listinfo/clisp-cvs End of clisp-cvs Digest, Vol 42, Issue 19 ***************************************** ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ clisp-devel mailing list clisp-devel@... https://lists.sourceforge.net/lists/listinfo/clisp-devel |
| Free embeddable forum powered by Nabble | Forum Help |