D 2009-09-29T19:46:13 J icomment I\sdon't\sthink\sthat\srecursive\smutex\swill\shelp.\sCannot\smodify\sglobal\sdata\ssafely\sin\sa\ssignal\shandler\swithout\sbe\ssure\sthat\syou\sare\salone.\nAgree\sthat\sthe\sproblem\scannot\sbe\ssolved\swithout\shelp\sof\sanother\sthread\sthat\sdoes\snot\sreceive\ssignals.\nPlease\salso\snote\sthat\sthere\smay\sbe\sseveral\ssignals\scome\sbefore\s"end\sof\sspecial\shandling".\nDraft\sidea:\nNeed\sa\sthread\sthat\sblocks\sall\ssignals\s(except,\smaybe\sone,\susr123)\sor\sdoes\snot\suse\snotifierMutex.\sLet's\scall\sit\sright_thread.\nAsyncMark:\n-\sif\s(trylock(¬ifierMutex)\s==\s0)\n-\s\s\s\s//\snormal\scode\n-\slock\s(&another_mutex)\n-\squeue\sasync_tls_data\n-\sunlock\s(&another_mutex)\n-\swake\sup\sright_thread\s(using\spthread_kill(right_thread,usr123)\sor\spthread_cond_signal)\nright_thread:\n-\slock\s(&another_mutex)\n-\stake\sasyn_tls_data\sfrom\squeue\n-\ssave\sasync_tls_data\sto\sright\sinterp\n-\sunlock\s(&another_mutex)\n\nThere\sis\sa\snon-blocking\stechnique\sto\smodify\sglobal\sdata.\sMay\salso\sbe\sused\sin\sany\ssolution.\n J login eugene_cdn J mimetype text/plain J username eugene_cdn K 2869384fffffffffffffffffffffffffffffffff U eugene_cdn Z b14cd9c116285dfe880a3229302eb23e