why i can't write anything to a custom cache table? First in mymodule.install I declared mymodule_schema(hook_schema) mymodule_install() and mymodule_unistall()

Where mymodule_schema() is like this:

function mymodule_schema() {
    $schema = array();
    $schema['cache_mymodule'] = drupal_get_schema_unprocessed('system', 'cache');
    return $schema;
}


this worked perfectly and table cache_mymodule with the same structue as table cache was created.But in my code, using this:

$cid=some_calcuated_cid();
$cache=cache_get($cid,'cache_mymodule');
if (!$cache){
    $data = some_calcuated_data();
    cache_set($cid,$data,'cache_mymodule');
    dpm('CACHE SET');
else {
    dpm('used cache');
}


I always get 'CACHE SET', Now if i change 'cache_mymodule' to just cache, Or remove it, It works perfectly (saying used cache), Am I missing some hook in mymodule?
You don't need to create your own table to use the internal cache. Just use cache_set() and cache_get() as documented. This will store the $my_data in the default 'cache' table:

// Store $my_data in cache.
cache_set($data_id, $my_data);

// Get $my_data from cache.
$data = cache_get($data_id);


Your code snippet should look something like this:

$cid = some_calcuated_cid();
$cache = cache_get($cid);

if (!$cache){
  $data = some_calcuated_data();
  cache_set($cid, $data);
}


Documentation:

cache_set()

cache_get()