Hi Tobias,

Thanks for the info. I thought Pike would run all threads simultaneously when number of threads does not exceed number of available processors and otherwise using time sharing like other languages. I am still learning Pike and hence not familiar with I/O operations in Pike so maybe later will find out when to get benefit of concurrency when Pike is used.

Regards,

Danesh




On Fri, May 2, 2014 at 5:55 PM, Tobias S. Josefowitz <t.josefowitz@gmail.com> wrote:
Hi Danesh!

On Fri, May 2, 2014 at 5:34 PM, Danesh Daroui <danesh.daroui@gmail.com> wrote:
> Hi,
>
> Thanks for your answer. I guess threads is something that I was looking for.
> By concurrency I meant being able
> to spawn multiple threads which will logically run in parallel. Moreover
> having the possibility to define mutex
> and semaphores which are apparently done in Pike (mutex is at least done)
> and also barrier and join threads, etc.

Pike indeed has support for that, as you discovered. However, beware
of the global interpreter lock. Pike code will never really run
concurrently (i.e. more than one thread executing Pike code at the
same time on more than one CPU/core). All concurrency you can get is
on blocking I/O operations and possibly some heavier computations
offered by the Pike "standard library".

Tobi