Overview
| Artifact ID: | 18c1ed8f9b851c24d3bc588e77f2742d710fc659 |
|---|---|
| Ticket: | 674367ffffffffffffffffffffffffffffffffff
call for a function that is not thread safe |
| User & Date: | elfring on 2003-01-24 23:39:57 |
Changes
- assignee changed to: "vasiljevic"
- cmimetype changed to: "text/plain"
- comment changed to:
I describe an use case for the handling of unsafe functions calls with the thread package. I must assume that an application programming interface (like a graphics library or a music API) or even a single function is not thread safe if this property is not described in the documentation for that API. So I must ensure that all unsafe functions are executed by a single thread at each time. I want to create a thread for each function library that must be handled as it has not implemented thread safety at startup/initialization time of my application. I want to achieve that calls into different unsafe libraries can be executed simultaneously. I can perform the call with the function "thread::send" for a thread that has been created before. But I think that I will need a special kind of mutual exclusion. I understand the thread package's documentation in the way that a mutex that is created by the command "thread::mutex create" belongs to the calling thread. It may not be stored in a thread shared variable. Please correct me if I make wrong assumptions here. I guess that the function "thread::eval" does not all what I want and need here. It does not expect a thread indentifier in its argument list. I need a mutex that is global to the process scope (http://citeseer.nj.nec.com/cs?cs=1&q=synchronization+and+global+and+mutex&submit=Documents&co=Expected+Citations&cm=50&cf=Any&ao=Expected+Citations&am=20&af=Any ) to perform a protected and synchronous call of a code piece that should be executed by an other thread. I would like to suggest new functions like the following. 1. thread::mutex::create global or thread::mutex -global create 2. thread::safecall id global_mutex script ?varname? How do you think about this suggestion? Does this use case lead to add more synchronization primitives to the thread package? - foundin changed to: "None"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "elfring"
- subsystem changed to: "80. Thread Package"
- title changed to: "call for a function that is not thread safe"
- type changed to: "RFE"