Software Outsourcing, Offshore Software Development, Offshore Outsourcing Services, IT Outsourcing, Offshore Development
MySQL manual Offshore Software Outsourcing and Programming, IT Outsourcing Offshore Software Development  
Call Us Today: 1-800-678-9001
Offshore Software Outsourcing and Programming, IT Outsourcing Offshore Software Development

Home / Technical Support / MySQL

Key Offerings:

B2B and B2C E-Business Solutions

Offshore Software Development Outsourcing

Strategic Consulting

Offshore Software Outsourcing

About ALTOROS: ALTOROS Systems is headquartered in Tampa, Florida and maintains an office near Boston, Massachusetts and technology development center in Belarus and Russia. ALTOROS specializes on providing value-added e-commerce and web-based software development and offshore software outsourcing services to emerging enterprises helping them successfully plan and implement business initiatives.

Contact Us for more information.

Node: RTS-threads, Next: Thread packages, Prev: Locking methods, Up: Porting
Comments about RTS threads
 
I have tried to use the RTS thread packages with MySQL but stumbled on the following problems:
 
They use an old version of a lot of POSIX calls and it is very tedious to make wrappers for all functions. I am inclined to think that it would be easier to change the thread libraries to the newest POSIX specification.
 
Some wrappers are already written. See mysys/my_pthread.c for more info.
 
At least the following should be changed:
 
pthread_get_specific should use one argument.  sigwait should take two arguments.  A lot of functions (at least pthread_cond_wait, pthread_cond_timedwait) should return the error code on error. Now they return -1 and set errno.
 
Another problem is that user-level threads use the ALRM signal and this aborts a lot of functions (read, write, open...).  MySQL should do a retry on interrupt on all of these but it is not that easy to verify it.
 
The biggest unsolved problem is the following:
 
To get thread-level alarms I changed mysys/thr_alarm.c to wait between alarms with pthread_cond_timedwait(), but this aborts with error EINTR.  I tried to debug the thread library as to why this happens, but couldn't find any easy solution.
 
If someone wants to try MySQL with RTS threads I suggest the following:
 
      ·      Change functions MySQL uses from the thread library to POSIX.  This shouldn't take that long.
 
      ·      Compile all libraries with the -DHAVE_rts_threads.
 
      ·      Compile thr_alarm.
 
      ·      If there are some small differences in the implementation, they may be fixed by changing my_pthread.h and my_pthread.c.
 
      ·      Run thr_alarm. If it runs without any "warning", "error" or aborted messages, you are on the right track. Here is a successful run on Solaris:
Main thread: 1
Thread 0 (5) started
Thread: 5  Waiting
process_alarm
Thread 1 (6) started
Thread: 6  Waiting
process_alarm
process_alarm
thread_alarm
Thread: 6  Slept for 1 (1) sec
Thread: 6  Waiting
process_alarm
process_alarm
thread_alarm
Thread: 6  Slept for 2 (2) sec
Thread: 6  Simulation of no alarm needed
Thread: 6  Slept for 0 (3) sec
Thread: 6  Waiting
process_alarm
process_alarm
thread_alarm
Thread: 6  Slept for 4 (4) sec
Thread: 6  Waiting
process_alarm
thread_alarm
Thread: 5  Slept for 10 (10) sec
Thread: 5  Waiting
process_alarm
process_alarm
thread_alarm
Thread: 6  Slept for 5 (5) sec
Thread: 6  Waiting
process_alarm
process_alarm

...
thread_alarm
Thread: 5  Slept for 0 (1) sec
end
 
Offshore Software Outsourcing company Russia Florida Massachusetts Boston Belarus, Offshore Software Development Services, Offshore Programming and IT OutsourcingOffshore Development, Programming  Services, Tampa FL Russia, E-commerce, Database, CRM, Financial Insurance Health Care Real EstateOffshore Software Development Services, Software Outsourcing Russia
HOME PAGE, Offshore Software Outsourcing Company, offshore IT outsourcing services, offshore 
software development Russia Massachusetts Florida New York CT VT RI software development