| Anonymous | Login | Signup for a new account | 2013-06-19 07:48 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
| 0004032 | OCaml | OCaml general | public | 2006-05-26 23:29 | 2006-06-13 11:35 | ||||||
| Reporter | mottl | ||||||||||
| Assigned To | |||||||||||
| Priority | normal | Severity | feature | Reproducibility | always | ||||||
| Status | acknowledged | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | 3.09.2 | ||||||||||
| Target Version | Fixed in Version | ||||||||||
| Summary | 0004032: Associating pthread_t with a thread descriptor impossible | ||||||||||
| Description | This is an important feature that is missing from the current OCaml-implementation: it is currently not possible to extract the pthread_t associated with a thread (thread descriptor). This means it is impossible to implement certain POSIX-functions (e.g. pthread_getcpuclockid, etc.) operating on threads (other than the currently executing one - we can always get this one with pthread_self()) without hacking the OCaml-runtime sources. Why not e.g. just store the pthread_t of a thread in its descriptor? | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Notes |
|
|
(0003650) bhurt-aw (reporter) 2006-06-01 23:27 |
The specific file you have to hack is posix.c in the otherlibs/systhreads library. What this file needs is a function like: pthread_t get_pthread_t (Value descr) { /* Get the associated pthread_t for a given thread descriptor */ caml_thread_t curr; curr = curr_thread; do { if (curr->descr == descr) { return curr->pthread; } curr = curr->next; } while (curr != curr_thread); return NULL; } Unfortunately, this routine needs a number of definitions out of the posix.c file (the definition of caml_thread_t if nothing else). Note that this function doesn't scale well with large numbers of threads- in that case, some better solution might be engineered. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2006-05-26 23:29 | mottl | New Issue | |
| 2006-06-01 23:27 | bhurt-aw | Note Added: 0003650 | |
| 2006-06-13 11:35 | xleroy | Status | new => acknowledged |
| Copyright © 2000 - 2011 MantisBT Group |