[llvm-commits] VM hooks when locking

Nicolas Geoffray nicolas.geoffray at lip6.fr
Thu Jul 30 23:55:03 PDT 2009


Hi Owen,

Owen Anderson wrote:
> Nicholas,
>
> On Jul 30, 2009, at 2:20 PM, Nicolas Geoffray wrote:
>> Is it OK to apply this patch? It provides hooks for llvm users 
>> (especially VM implementors) to control when a thread blocks on a 
>> mutex. It is very useful if the VM wants to know the state of each 
>> thread it is running.
>
> I'm unclear on how this will be useful without knowing /what/ is being 
> locked on? 

So In my case (vmkit), I don't really care about /what/ is being locked 
on. All I need is the information that the thread /is/ blocked. I 
understand that for a debugging/monitoring/whatever system, it would be 
nice to know /what/, but that demands a more high-level solution.

> Also, do you need a version for recursive mutexes as well?

The only places where the VM-provided functions must be called is when 
there are chances the thread will be blocked. I believe the only place 
in llvm where a thread may be blocked is when it calls the 
pthread_mutex_lock, and that is only in Mutex.cpp. I believe the 
recursive and normal mutexes share the same function.

Thanks,
Nicolas

>
> --Owen
> ------------------------------------------------------------------------
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>   




More information about the llvm-commits mailing list