Coder Social home page Coder Social logo

eo-threads's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

eo-threads's Issues

EOmutexTest.java:78-82: Uncomment this test when problem...

The puzzle 33-016de260 from #33 has to be resolved:

// @todo #33:90min Uncomment this test when problem
// of the of same hashcodes in parallel threads
// will be solved. This test proves new Phi objects
// created in parallel threads can have repeated
// hashcodes

The puzzle was created by @levBagryansky on 01-Oct-22.

Estimate: 90 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

EOmutexTest.java:112-115: Implement test like the test...

The puzzle 33-5c60b9c8 from #33 has to be resolved:

// @todo #33:90min Implement test like the test
// below where new Phi objects are created in
// parallel instead of one thread. We need to
// wait for the solving of hashcode problem

The puzzle was created by @levBagryansky on 01-Oct-22.

Estimate: 90 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

mutex-test.eo:85-89: Implement test of mutex with 2...

The puzzle 12-c377ed5d from #12 has to be resolved:

# @todo #12:90min Implement test of mutex
# with 2 threads that acquires mutex,
# sleep and then releas. So in fact
# they must sleep in series, not parallely.
# You can do it when sys-call will be released.

The puzzle was created by @levBagryansky on 15-Sep-22.

Estimate: 90 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

thread.stop problem

It seems I cannot yet implement thread.stop.
This is implementation of run in DataizingThread.java:

    public Phi dataized() {
        return this.computed;
    }

    @Override
    public void run() {
        this.computed = new Data.ToPhi(new Dataized(this.eothread.attr("slow").get()).take());
    }

And stop in its dataization will do

      final Phi parent = rho.attr("ฯ").get();
      final DataizingThread thr = Threads.INSTANCE.get(parent);
      thr.interrupt();
      return new Data.ToPhi(true);

So in DataizingThread.java it must be

    @Override
    public void run() {
        try {
            this.computed = new Data.ToPhi(new Dataized(this.eothread.attr("slow").get()).take());
        } catch (InterruptedException ie){
        }
    }

But compiler does not allow do that because
Exception 'java.lang.InterruptedException' is never thrown in the corresponding try block
So Dataized.get does not throw it. But Thread.sleep that is used in EOsleep.java can do.
@yegor256 @mximp may be we have other ways to stop the thread? I see only bad variants like deprecated Thread.stop and may be JNI. Or we need to mark some nethods in eo throws InterruptedException?

More tests for thread

We need to add tests for thread using threads.sleap and QQ.sys.call "gettimeofday" when it wiill be released

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/codecov.yml
  • actions/checkout v4
  • actions/setup-java v4
  • actions/cache v3
  • codecov/codecov-action v4
  • ubuntu 22.04
.github/workflows/mvn.yml
  • actions/checkout v4
  • actions/setup-java v4
  • actions/cache v3
.github/workflows/pdd.yml
  • actions/checkout v4
  • ubuntu 22.04
.github/workflows/xcop.yml
  • actions/checkout v4
  • ubuntu 22.04
maven
pom.xml
  • com.jcabi:parent 0.66.0
  • org.eolang:eo-runtime 0.32.0
  • org.junit.jupiter:junit-jupiter-api 5.10.1
  • org.junit.jupiter:junit-jupiter-params 5.10.1
  • org.cactoos:cactoos 0.55.0
  • org.apache.maven.plugins:maven-compiler-plugin 3.8.1
  • org.eolang:eo-maven-plugin 0.32.0

  • Check this box to trigger a request for Renovate to run again on this repository

mutex-test.eo:108-111: Implement this test with using...

The puzzle 61-0d624b73 from #61 has to be resolved:

# @todo #61:90min Implement this test with
# using list and reduced of the list. So we
# need to create the list of threads and
# start them in list.reduced

The puzzle was created by @levBagryansky on 16-Oct-22.

Estimate: 90 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

sleep object

Let's implement QQ.threads.sleep according to #9 " which makes dataization pause for the given amount of milliseconds"

testing of thread

To be sure thread dataizes it's argument slow after start we can implement time and sleep objects that helps to regulate dataization time sleep does it) and measure (time does it) :
[millis] > sleep stops dataization for millis milliseconds
[] > time is an analog of System.currentTimeMillis() in java.
So we can write

[] > test-it-dataizes-after-start
  thread > a
    sleep 3000
  thread > b
    sleep 3000
  memory 0 > m1
  memory 0 > m2
  seq > @
    m1.write
      time
    a.start
    b.start
    a.join
    b.join
    m2.write
      time
    gt.
      4000
      minus.
        m1
        m2

Here we can be sure a and b works in parallel.
@yegor256 @mximp What do you think?

first release

Let's configure Rultor the same way it's done in eo-files, and release the first version to Maven Central

Mutex last design

@yegor256 last time we decided mutex should look like this:

[permits] > mutex
  [] > acquire
    [] > @ /bool
    [] > release /bool

to use the mutex the way:

[] > acquire-release
  mutex 100 > m
  seq > @
    m.acquire > a
    a.release
    m.acquire > b
    b.release

But it makes us to copy mutex.acquire if we want to distinguish a and b. In fact it would be better adding ':

[] > acquire-release
  mutex 100 > m
  seq > @
    m.acquire' > a
    a.release
    m.acquire' > b
    b.release

And here I faced this issue:
objectionary/eo#1214

Package name suggestion

In my opinion, this would be more convinient to call the base package QQ.concurrent (or QQ.concurrency) rather than QQ.threads.

`t` or `x`

Looks like a typo: used t instead of x to reference the thread object in README (at line 20)

QQ.threads.thread > x
  [t]
    very-slow-object > @
while.
  t.is-running
...

DataizingThread.java:69-72: Implement handling of...

The puzzle 14-d4ce4bb2 from #14 has to be resolved:

// @todo #14:90min Implement handling of
// Interrupted Exaption when the get method
// will throw it. We need to wait for changes
// in eo repository to do that.

The puzzle was created by @rultor on 08-Sep-22.

Estimate: 90 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

usage of threads

@mximp
Please rate my suggestion. I came with 2 usage of threads.

  1. Its enough ordinary usage. You just run the thread and can use several attributes to get its state: join, is-alive, etc .
[] > usage1
  QQ.threads.thread > my-thread
    slow-obj
  seq > @
    run.
      my-thread
    do-smth
    join.
      my-thread
  1. The fist usage may have too imperative style. So its alternative. You can declarative some threads in one place and run it where you need. It will return true after finish.
 [] > usage2
  QQ.threads.thread-set > my-thread-set
    slow-obj1
    slow-obj2
    slow-obj3
  run. > @
    my-thread-set

Valid metas

We need to set valid metas in all eo-files.
@yegor256 I would like to do it in separate pull request

mutex-test.eo:106-110: Implement test with numerous...

The puzzle 33-42a5749e from #33 has to be resolved:

# @todo #33:90min Implement test with
# numerous threads that will acquire
# and releasse mutex in parallel
# We need to wait for solving a problem
# with different hashcodes.

The puzzle was created by @levBagryansky on 01-Oct-22.

Estimate: 90 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

mutex.eo:33-35: We need to count numbers of locks and...

The puzzle 12-aaf1d833 from #12 has to be resolved:

# @todo #12:90min We need to count numbers of locks
# and releases in order to throw exceptions
# if there were more releases then locks

The puzzle was created by @levBagryansky on 15-Sep-22.

Estimate: 90 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

thread-test.eo:160-163: Impplement test that stops a...

The puzzle 14-371bfc16 from #14 has to be resolved:

# @todo #14:60min Impplement test
# that stops a thread and checks
# if the thread is running. We need
# is-running attribute to use it

The puzzle was created by @levBagryansky on 25-Sep-22.

Estimate: 60 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.